【发布时间】:2014-04-29 23:40:39
【问题描述】:
register.jsp
<body>
<div id="container" >
<div id="header-container">
<div id="header">
<div id="logo"><h2>Loc</h2></div>
</div>
</div>
<hr id="line">
<div id="content">
<form name="newUserForm" onsubmit="return validate()" method="POST" action="rest/user/registerUser">
RegisterUser.java
@Path("/registerUser")
@POST
//@Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
@Produces(MediaType.APPLICATION_JSON)
public LocResponse registerUser (
@FormParam("userName") String userName,
@FormParam("userEmail") String userEmail,
@FormParam("loginIp") String loginIp,
@FormParam("userGrp") String userGrp,
@FormParam("pwd") String password,
)
我们正在使用 Jersey 并且能够创建 JSON 作为响应,但不确定如何将其作为 reposne 获取并使用 register.jsp 对其进行解析。
【问题讨论】:
-
@BrianRoach - 我正在寻找如何处理 JSON 作为 JSP 页面上的响应,但我没有看到您提到的链接上的 JSP,所以它为什么是 ( stackoverflow.com/questions/22454427/…?
标签: java json jsp rest servlets