I have seem some question similar like mine(like this one), but none of them solved my question. So I'll post one.
My JSP website structure is like this:
/subpage/funcA.jsp /main.jsp
My main page contains all necessary js and css definitions, subpages don't have those defines. So If I'm going to display my funcA page properly, its URL will need to be written like this
Here's the problem: I'm trying to use forward()
to send some attributes to funcA.jsp
, so I can pre-fill those attributes into form texts in funcA.jsp. But I can't get it working! All I got is 404s.
Here's my forward code:
RequestDispatcher dispatcher = getServletContext()
.getRequestDispatcher("/main.jsp#subpage/funcA.jsp");
dispatcher.forward(req, res);
Can anyone tell me what did I miss? thanks.