Wednesday, November 24, 2010

How to run servlet in tomcat 6.0.18.My servlet gets compiled but browser doesn't show output I think my url is?

not right my source code and compiled class file is in webapps/ROOT/WEB-INF/classes/ . I created classes folder manually. i use windows xp my url is http:localhost:8082/servlet/HelloWorld. While installing tomcat I change port 8080 to 8082.As i also use glassfish v3 whose port is 8080.Please tell me the answer . Also tell me how to run the servlet in glassfish in v3How to run servlet in tomcat 6.0.18.My servlet gets compiled but browser doesn%26039;t show output I think my url is?
Here's Standard Directory Layout for tomcat under any webapplication like you have ROOT



/WEB-INF/web.xml - The Web Application Deployment Descriptor for your application.



/WEB-INF/classes/ - This directory contains any Java class files (and associated resources) required for your application,



/WEB-INF/lib/ - This directory contains JAR files that contain Java class files (and associated resources) required for your application, such as third party class libraries or JDBC drivers.



*.html, *.jsp, etc. - The HTML and JSP pages, along with other files that must be visible to the client browser (such as JavaScript, stylesheet files, and images) for your application.





In order to run Manager UI

you need to have

%26lt;role rolename=%26quot;manager%26quot;/%26gt;

%26lt;user username=%26quot;admin%26quot; password=%26quot;%26quot; roles=%26quot;manager%26quot;/%26gt;

in /conf/tomcat-users.xml



There you will have list of all applications installed

can reach the application by clicking over 'em.



--------

Well, though you had made correct port number entries still i guess you URL should be

http:localhost:8082/ROOT/servlet/Hello?br>


Make sure you have proper entries of servelet url mapping as servlet/HelloWorld

in web.xml



Considering these steps you will be able to up your screens.



Hope this helps

Cheers:)How to run servlet in tomcat 6.0.18.My servlet gets compiled but browser doesn%26039;t show output I think my url is?
check if u have included the classes folder to your build path.

No comments:

Post a Comment