私のプロジェクトには 2 つのモジュールが含まれています。a. ユーザー登録 b. ユーザー ビュー プロファイル
UserRegistration モジュールでは、ユーザーから詳細を取得し、データベースに挿入します。UserRegistrationImpl は、セッションに接続されたユーザーごとに 1 つの ID を生成します。また、詳細が挿入されたという確認を UserRegistration クライアント プログラムに送信します。Userregistration Client がセッションから共通 ID にアクセスする UserViewProfile モジュールにリダイレクトされ、それに基づいてデータベースからデータを取得して詳細をユーザーに表示するようにします。最新の GWT バージョンを使用しています。
リダイレクト中に、web.xml でサーブレット参照の問題に直面しています。次のようなエラーを表示します:
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 -->