Howdy all. I got this nitpick back a few days ago:
Rather than going directly to the jsp, you should make all your access to jsp pages pass through the servlet. Your URL should look something like this:
/videos/servlet/VideoServlet?action=addvideo
OK. I've tried this and can't get it to work. Perhaps because I don't fully understand what it's doing, maybe (I don't remember reading much about it in Head First Servlets & JSP). But anyway, all it does when I write the URL like that is to reload the listvideos.jsp page (which is where this link is written). I can't seem to get it to load the addvideo.jsp page no matter how I write the URL (I've tried .../VideoServlet?action=addvideo.jsp, .../VideoServlet?action=addvideo, .../VideoServlet?forward=addvideo.jsp, etc.).
Any suggestions, help, advise, etc would be greatly appreciated. Thanks!
Marilyn de Queiroz
Sheriff
Joined: Jul 22, 2000
Posts: 9033
10
posted
0
Do you have an "action" in your servlet that matches the "action" in the url? Otherwise, the servlet will do the "default" action.
JavaBeginnersFaq "Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Matt Fry
Ranch Hand
Joined: Mar 06, 2006
Posts: 60
posted
0
Man, that was a tough one (for me anyways). Had to dig a little bit but learned several things I didn't know and had just taken for granted. Thanks!
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Accessing a jsp through a servlet problem