I have two login pages: AM and Customer login page. When the AM Login successfully it redirects to the chat page with the map /am/chatPage and with the customer it redirects to /customer/chatPage. My problem is it doesn't load the JSP file.
Here is the error in glassfish:
Info: Show AM CHATPAGE--------------------
Severe: PWC6117: File "null" not found
Note: The login process is handled by Spring Web Security in my WebSecurityConfig.java
In my Login Controller I have @RequestMapping() for AM Chat page:
@RequestMapping(value = "/am/chatPage", method = RequestMethod.GET)
public String chatpage(Model model)
{
System.out.println("Show AM CHATPAGE--------------------");
model.addAttribute("name","Sample name");
model.addAttribute("twitter","@sample");
return "amChatPage";
}
and Customer Chat Page:
@RequestMapping(value = "/customer/chatPage", method = RequestMethod.GET)
public String showCustChat(Model model)
{
System.out.println("SHOW CUSTOMER CHAT----------------------");
return "customerChatPage";
}
Below is my SpringWebAppInitializer
@Override
public void onStartup(ServletContext sc) throws ServletException
{
AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
context.register(ApplicationContextConfig.class);
ServletRegistration.Dynamic dispatcher = sc.addServlet("dispatcher", new DispatcherServlet(context));
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/");
}
Things that I've done so far:
- I tried the solution in PWC6117: File “null” not found using ModelAndView but still doesn't load.
- Added
dispatcher.addMapping("/am/");
ordispatcher.addMapping("/am/**");
in SpringWebAppInitializer.
Assumptions:
I have a controller for map /welcomepage and it works fine and shows the jsp. I also tried loading the amChatPage.jsp and customerChatPage.jsp in this controller and it works fine. I think this error appears with this map pattern /am/** or /customer/**. Can someone help me fix this problem?