如何在两个GWT模块之间重定向?

时间:2013-06-04 08:38:39

标签: gwt servlets redirect module web.xml

我的项目包含两个模块。 一个。用户注册 湾UserViewProfile

在UserRegistration模块中,我从用户那里获取了详细信息并将其插入到数据库中。听到UserRegistrationImpl将为每个用户生成一个ID&附在会议上。以及向UserRegistration客户端程序发送确认信息,以便插入详细信息。这样User注册客户端将重定向到UserViewProfile模块,该模块将从会话访问公共ID,并基于它将从数据库中检索数据以向用户显示详细信息。我正在使用最新的GWT版本。

在重定向时,我正面临web.xml中的servlet引用问题。 显示如下错误:

com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: //userviewpath/userview

看我的代码:

#UserRegistrationImpl#
HttpServletRequest request = this.getThreadLocalRequest();
HttpSession session = request.getSession(true);
System.out.println("s1:"+session);
session.setAttribute("SessionId", newId);
status="pass";
returnId.add(status);
returnId.add(Integer.toString(newId));

#UserRegistration#
if (result.get(0).equals("pass")) {
int addedID=Integer.parseInt(result.get(1));
String url=URLUtils.getRedirectURL("/UserViewProfile.html");
Window.Location.replace(url);
} else if (result.equals("fail")) {
dialogBox1.setWidget(Unotsuccesslbl);
#UserRegistrationInterface#
@RemoteServiceRelativePath("userreg")
public interface UserRegistrationInterface extends RemoteService 
{
ArrayList<String> addRegistrationDetails(UserRegDetails userDetails)throws 
IllegalArgumentException;
}
#UserViewProfileImpl#
HttpServletRequest request = this.getThreadLocalRequest();
HttpSession session = request.getSession(false);
System.out.println("s2 val:"+session.getAttribute("AyushId")); 
//userViewProfile need  this Id value
#UserViewProfileInterface#
@RemoteServiceRelativePath("userview")
public interface UserViewProfileInterface extends RemoteService 
ArrayList<String> GetProfileDetails(ArrayList<String> userProfileArray)
throws IllegalArgumentException;{}
#web.xml#
<!-- User Registration part start-->
<servlet>
<servlet-name>UserRegistrationImpl</servlet-name>
<servlet-class>com.testegg.ayushcare.server.UserRegistrationImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UserRegistrationImpl</servlet-name>
<url-pattern>/userregpath/userreg</url-pattern>
</servlet-mapping>
<!-- User Registration part end-->
<!-- UserViewProfile part start -->
<servlet>
<servlet-name>UserViewProfileImpl</servlet-name>
<servlet-class>com.testegg.ayushcare.server.UserViewProfileImpl
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UserViewProfileImpl</servlet-name>
<url-pattern>/userviewpath/userview</url-pattern>
</servlet-mapping>
<!-- UserViewProfile part end -->

0 个答案:

没有答案
相关问题