当前位置: 首页>>代码示例>>Java>>正文


Java FormParam类代码示例

本文整理汇总了Java中javax.ws.rs.FormParam的典型用法代码示例。如果您正苦于以下问题:Java FormParam类的具体用法?Java FormParam怎么用?Java FormParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FormParam类属于javax.ws.rs包,在下文中一共展示了FormParam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateSystemOption

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("/option/{optionName}")
@Consumes("application/x-www-form-urlencoded")
@Produces(MediaType.TEXT_HTML)
public Viewable updateSystemOption(@FormParam("name") String name, @FormParam("value") String value,
                                 @FormParam("kind") String kind) {
  try {
    work.getContext()
      .getOptionManager()
      .setOption(OptionValue.createOption(
        OptionValue.Kind.valueOf(kind),
        OptionValue.OptionType.SYSTEM,
        name,
        value));
  } catch (Exception e) {
    logger.debug("Could not update.", e);
  }
  return getSystemOptions();
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:20,代码来源:StatusResources.java

示例2: register

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("register")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public String register(@FormParam("userName") String userName,
		@FormParam("password") String password,
		@FormParam("phone") Long phone, @FormParam("email") String email,
		@FormParam("nick") String nick, @FormParam("addr") String addr,
		@FormParam("gender") String gender) {
	// check not null
	User u = new User();// dao 应该查询
	u.setAddr(addr);
	u.setEmail(email);
	u.setGender(gender);
	u.setNick(nick);
	u.setPassword(password);
	u.setPhone(phone);
	u.setUsername(userName);
	return JsonUtil.bean2Json(u);
}
 
开发者ID:jiumao-org,项目名称:wechat-mall,代码行数:20,代码来源:IndexResource.java

示例3: save

import javax.ws.rs.FormParam; //导入依赖的package包/类
@Path("/save")
@POST
public Single<Response> save(@FormParam("id") String id,
		@FormParam("title") String title,
		@FormParam("markdown") String markdown,
		@FormParam("newPage") String newPage){
	return fiber(() -> {
		boolean isNewPage = "yes".equals(newPage);
		String requiredPermission = isNewPage ? "create" : "update";
		if(!await(user.rxIsAuthorised(requiredPermission)))
			throw new AuthorizationException("Not authorized");

		PagesDao dao = (PagesDao) AppGlobals.get().getGlobal("dao");
		Single<Integer> query;
		if(isNewPage)
	        query = dao.client().execute(DSL.using(dao.configuration()).insertInto(dao.getTable())
	        		.columns(Tables.PAGES.NAME, Tables.PAGES.CONTENT)
	        		.values(title, markdown));
		else
			query = dao.updateExecAsync(new Pages().setId(Integer.valueOf(id)).setContent(markdown));
		await(query);
		URI location = Router.getURI(WikiResource::renderPage, title);
		return Response.seeOther(location).build();
	});
}
 
开发者ID:FroMage,项目名称:redpipe,代码行数:26,代码来源:WikiResource.java

示例4: createUser

import javax.ws.rs.FormParam; //导入依赖的package包/类
@PUT
@Path("/users")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public String createUser(
        @FormParam("id") int id,
        @FormParam("name") String name,
        @FormParam("profession") String profession)
{
    User user = new User(id, name, profession);
    int result = userDao.addUser(user);
    if (result == 1)
    {
        return SUCCESS_JSON;
    }

    return FAILURE_JSON;
}
 
开发者ID:nfriaa,项目名称:javase-restful-server,代码行数:19,代码来源:UserService.java

示例5: save

import javax.ws.rs.FormParam; //导入依赖的package包/类
@Path("/save")
@POST
public Single<Response> save(@FormParam("id") String id,
		@FormParam("title") String title,
		@FormParam("markdown") String markdown,
		@FormParam("newPage") String newPage){
	return fiber((con) -> {
		boolean isNewPage = "yes".equals(newPage);
		String requiredPermission = isNewPage ? "create" : "update";
		if(!await(user.rxIsAuthorised(requiredPermission)))
			throw new AuthorizationException("Not authorized");

		String sql = isNewPage ? SQL.SQL_CREATE_PAGE : SQL.SQL_SAVE_PAGE;
		JsonArray params = new JsonArray();
		if (isNewPage) {
			params.add(title).add(markdown);
		} else {
			params.add(markdown).add(id);
		}
		await(con.rxUpdateWithParams(sql, params));
		URI location = Router.getURI(WikiResource::renderPage, title);
		return Response.seeOther(location).build();
	});
}
 
开发者ID:FroMage,项目名称:redpipe,代码行数:25,代码来源:WikiResource.java

示例6: getById

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("{id}")
@Produces(MediaType.APPLICATION_JSON)
@Consumes({MediaType.APPLICATION_FORM_URLENCODED})
public Cliente getById(@PathParam("id") int id,
		@QueryParam("citta") String citta,
		@FormParam("parametro") String nome) {
	Cliente c = new Cliente();
	c.setNome(nome + " : " + id);
	c.setPartitaIva("658736457634");
	c.setTelefono(citta);
	return c;
}
 
开发者ID:andrea-colleoni,项目名称:corso-lutech,代码行数:14,代码来源:ClienteAPI.java

示例7: accountStatus

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("accountalias")
public BaseDTO accountStatus(@FormParam("username") String username) {
    BaseDTO baseDto = new BaseDTO();

    try {
        baseDto.setCode(200);
        baseDto.setData(accountAliasConverter.convertAlias(username));
    } catch (Exception ex) {
        logger.error(ex.getMessage(), ex);
        baseDto.setCode(500);
        baseDto.setMessage(ex.getMessage());
    }

    return baseDto;
}
 
开发者ID:zhaojunfei,项目名称:lemon,代码行数:17,代码来源:AccountStatusResource.java

示例8: helloHelloPost

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_PLAIN)
public String helloHelloPost(@FormParam("me") final String me) {

    return "HelloHello " + me;
}
 
开发者ID:trajano,项目名称:app-ms,代码行数:8,代码来源:SingleHello2.java

示例9: updateRegistrationTemplateSampleData

import javax.ws.rs.FormParam; //导入依赖的package包/类
@PUT
@Path("/{id}/sampledata")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "update sampledata")
@ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response updateRegistrationTemplateSampleData(@Context HttpServletRequest request,
		@Context HttpHeaders header, @Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext,
		@ApiParam(value = "id of DeliverableType", required = true) @PathParam("id") long registrationTemplatesId,
		@ApiParam(value = "sampledata of  registrationTemplate", required = true) @FormParam("sampleData") String sampledata);
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:15,代码来源:RegistrationTemplatesManagement.java

示例10: handleSubmit

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("/new")
@Consumes(APPLICATION_FORM_URLENCODED)
public Response handleSubmit(
        @FormParam("name") final String name,
        @FormParam("address") final String address,
        @FormParam("city") final String city,
        @FormParam("telephone") final String telephone) {

    final Owner owner = new Owner();
    owner.setName(name);
    owner.setAddress(address);
    owner.setCity(city);
    owner.setTelephone(telephone);
    dao.create(owner);
    return Response.seeOther(URI.create(owner.getUrl())).build();
}
 
开发者ID:minijax,项目名称:minijax,代码行数:18,代码来源:OwnersResource.java

示例11: updateRegFormFormData

import javax.ws.rs.FormParam; //导入依赖的package包/类
@PUT
@Path("/registrations/{id}/forms/{referenceUid}/formdata")
@Consumes({ MediaType.APPLICATION_FORM_URLENCODED })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@ApiOperation(value = "update RegistrationForm")
@ApiResponses(value = { @ApiResponse(code = HttpURLConnection.HTTP_OK, message = "Returns"),
		@ApiResponse(code = HttpURLConnection.HTTP_UNAUTHORIZED, message = "Unauthorized", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_NOT_FOUND, message = "Not found", response = ExceptionModel.class),
		@ApiResponse(code = HttpURLConnection.HTTP_FORBIDDEN, message = "Access denied", response = ExceptionModel.class) })
public Response updateRegFormFormData(@Context HttpServletRequest request, @Context HttpHeaders header,
		@Context Company company, @Context Locale locale, @Context User user,
		@Context ServiceContext serviceContext,
		@ApiParam(value = "registrationId", required = true) @PathParam("id") long id,
		@ApiParam(value = "referenceUid", required = true) @PathParam("referenceUid") String referenceUid,
		@ApiParam(value = "formdata of registrationForm", required = true) @FormParam("formdata") String formdata)
		throws PortalException;
 
开发者ID:VietOpenCPS,项目名称:opencps-v2,代码行数:17,代码来源:RegistrationFormManagement.java

示例12: saveUser

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Consumes("application/x-www-form-urlencoded")
@Produces("application/json")
@Path("/save")
public Object saveUser(@FormParam("userName") String userName,@FormParam("userPass") String userPass){
	String jsonData = "";
	User u = new User();
	u.setUserName(userName);
	u.setUserPass(userPass);
	try {
		userService.save(u);
	} catch (Exception e) {
		//-- 统一在过滤器中添加跨域访问的header信息,所以这里就不添加了
		jsonData = JsonUtil.toJsonByProperty("addUser","failure");
		return Response.ok(jsonData).status(HttpServletResponse.SC_INTERNAL_SERVER_ERROR ).build();
	}
	jsonData = JsonUtil.toJsonByProperty("id", u.getId());
	return Response.ok(jsonData).status(HttpServletResponse.SC_OK).build();
}
 
开发者ID:ranji1221,项目名称:clemon,代码行数:20,代码来源:UserResource.java

示例13: formResult

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Produces(MediaType.TEXT_HTML)
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public FreeMarkerOnlineView formResult(
        @FormParam("template") String template,
        @FormParam("dataModel") String dataModel,
        @FormParam("outputFormat") String outputFormat,
        @FormParam("locale") String locale,
        @FormParam("timeZone") String timeZone) {
    FreeMarkerOnlineView view = new FreeMarkerOnlineView();
    view.setTemplate(template);
    view.setDataModel(dataModel);
    view.setOutputFormat(outputFormat);
    view.setLocale(locale);
    view.setTimeZone(timeZone);
    view.setExecute(true);
    return view;
}
 
开发者ID:apache,项目名称:incubator-freemarker-online-tester,代码行数:19,代码来源:WebPageResource.java

示例14: initParameterAnnotationMgr

import javax.ws.rs.FormParam; //导入依赖的package包/类
@Override
protected void initParameterAnnotationMgr() {
  super.initParameterAnnotationMgr();

  parameterAnnotationMgr.register(PathParam.class, new PathParamAnnotationProcessor());
  parameterAnnotationMgr.register(FormParam.class, new FormParamAnnotationProcessor());
  parameterAnnotationMgr.register(CookieParam.class, new CookieParamAnnotationProcessor());

  parameterAnnotationMgr.register(HeaderParam.class, new HeaderParamAnnotationProcessor());
  parameterAnnotationMgr.register(QueryParam.class, new QueryParamAnnotationProcessor());
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:12,代码来源:JaxrsSwaggerGeneratorContext.java

示例15: login

import javax.ws.rs.FormParam; //导入依赖的package包/类
@POST
@Path("login")
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@AuthAnnotation
public User login(@FormParam("userName") String userName,
		@FormParam("password") String password,
		@FormParam("verificationCode") String verificationCode,
		@FormParam("phone") Long phone) {
	// check not null

	return null;
}
 
开发者ID:jiumao-org,项目名称:wechat-mall,代码行数:13,代码来源:IndexResource.java


注:本文中的javax.ws.rs.FormParam类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。