aspose file tools*
The moose likes Servlets and the fly likes Help: HTML -> SERVLET -> JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Help: HTML -> SERVLET -> JSP" Watch "Help: HTML -> SERVLET -> JSP" New topic
Author

Help: HTML -> SERVLET -> JSP

Jochen van Waasen
Ranch Hand

Joined: Jan 19, 2002
Posts: 33
Hi!
I need help with the following topic.
HTML -> invokes -> SERVLET -> forwards request -> JSP
I can't get this to work.
I use TOMCAT 4 and SUN JDK1.3
I have done the following:
The HTML -> invokes -> SERVLET works fine.

The following doGet method is called:

Nothing happens. My browser displays a blank page with no error messages.

My file structure:
TOMCAT_HOME/webapps/myApp/INDEX.HTML
TOMCAT_HOME/webapps/myApp/WEB-INF/classes/myServlet.class
TOMCAT_HOME/webapps/myApp/myJSP.jsp

I do not use WEB.XML file.

Where am I wrong?
Where to put the files?
Is there a problem with the correcut URL when trying to forward to JSP?

I got stuck with this.

Kind regards
Jochen

[ January 19, 2002: Message edited by: Jochen ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
Are both the servlet and the JSP in the same "web application"?
What do you mean "I do not use WEB.XML file." are you saying that you dont have a web.xml file in the /myApp/WEB-INF directory at all?
Jochen van Waasen
Ranch Hand

Joined: Jan 19, 2002
Posts: 33
Originally posted by William Brogden:
Are both the servlet and the JSP in the same "web application"?

They should be. They are in the same directory.

What do you mean "I do not use WEB.XML file." are you saying that you dont have a web.xml file in the /myApp/WEB-INF directory at all?

Exact, there is no web.xml in the /myApp/WEB-INF directory. What should it look like?
Kind regards
Jochen
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Have you tried taking off the application part, when requesting the dispatcher?

ie: request.getRequestDispatcher("/somepage.jsp");

And yes, you really should use web.xml, one wonders how you got your servlet to work at all. What does the HTML look like when you 'invoke' the servlet?

Anyways... look in the examples application for a look at what web.xml should look like, and finally, the servlet specification is helpfull as well.
[ January 19, 2002: Message edited by: Mike Curwen ]
Jochen van Waasen
Ranch Hand

Joined: Jan 19, 2002
Posts: 33
I guess the problem is solved, the JSP called by the servlet does not work.
Thanks
Jochen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help: HTML -> SERVLET -> JSP