1

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.

user6309529
  • 153
  • 1
  • 3
  • 16
  • 2
    `http://localhost/myProj/main.jsp#subpage/funcA.jsp` doesn't look correct url. did you tried manually accessing ? – Ravi Jan 26 '18 at 11:02
  • @Ravi Yes, I tried it on my browser and it runs normally. Frontend part seem like some kinda framework called "DevOOPS"? I'm not a frontend guy so not sure how it works. – user6309529 Jan 27 '18 at 14:17

1 Answers1

0

Since I got no way to find out "How" so far, and the deadline is near. So I dodged this problem by storing data into session and response redirect method. Move on to next problem.

user6309529
  • 153
  • 1
  • 3
  • 16