Hi all,

I want to run jsp programs, where should i place the folder in tomcat5.5 and how to run it.
please help me out.

Thanks

Recommended Answers

All 5 Replies

hi

open:
1 tomcat5.5
2.webapps folder
3.in webapps copy "web inf" and "lib" folder make sure that the lib folder contains all jar files reqrd.(asp.,jsp,servlet)
4. make ur own program folder in webapps itself.
and write ur jsp program with .jsp extensio.

then define the class path thru the my comp advace feature


try............. and enjoy

hi

open:
1 tomcat5.5
2.webapps folder
3.in webapps copy "web inf" and "lib" folder make sure that the lib folder contains all jar files reqrd.(asp.,jsp,servlet)
4. make ur own program folder in webapps itself.
and write ur jsp program with .jsp extensio.

then define the class path thru the my comp advace feature


try............. and enjoy

You just provided badly written answer to something that was answered with link to appropriate well written documentation

Hi,

I have created the folder structure.... but tell me out to write the classpath, i dont know...

one more doubt i have my servlet program given below.

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class valid extends HttpS ervlet
{
   public void doGet(HttpServletRequest req, HttpServletResponse res)throws IOException,ServletException
	{
	   res.setContentType("text/html");
	   PrintWriter out = res.getWriter();
	   String name = req.getParameter("name");
	   String password = req.getParameter("password");
	   out.println("<html>");
	   out.println("<head>");
	   out.println("<title> login page </title>");
	   out.println("<body>");
	   out.println("Name "+ name);
	   out.println("<br>");
	   out.println("your password is " + password );
	   out.println("</body>");
	   out.println("</html>");
	   out.close();
	} //end of service

} //end of class

and my index.html file given below

<html>
<head><title>Login Page</title></head>
<body>
<form method=get action="/Library/login">
<table>
 <tr>
  <td>Name: </td>
  <td><input type="text" Name="name"></td>
</tr>
 <tr>
 <td>Password:</td>
 <td><input type="password" Name="password"></td>
 </tr>
 <tr>
 <td><input type ="submit" value="submit"></td>
 <td>&nbsp;</td>
 </tr>
 </table>
 </body>
 </html>

and my web.xml code
<web-app>
<servlet>
<servlet-name>Library</servlet-name>
<servlet-class>valid</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Library</servlet-name>
<url-pattern>/Library/login</url-pattern>
</servlet-mapping>
</web-app >

how to write xml mapping,,,,,,,,i am getting an error,, Library/login not found and i am able to open index.html file , when i write http://localhost:8080 and after that i wil get above mentioned error......my folder structure is.......in webapps, i have created Library and in library, html file folder, WEB-INF and lib folders and index.html is their and in WEB-INF , src , classes and web.xml folders are their is this write and exactly where should be my jsp folder.................please reply .............its URGENT

You don't have to "write a classpath" for web apps.

You place any jar you need in the web-apps WEB-INF/lib directory, except JDBC libs may need to be placed in the "shared/lib" directory of tomcat.

Your own classes are to be placed in the WEB-INF/classes directory (with each package being a directory, as normal).

And give your class a package, that is a must. You should never write a class without a package. And classnames should be capitalised (not needed but it is standard, and, from most programmers, expected).

So, now assume you change valid to give it a package of authentication , and change the name from valid to Validator , the servlet-class would then be, of course, authentication.Validator , and that class will be located in WEB-INF/classes/authentication/Validator.class All of this (except the need for a package and classnames which are basic java) is explained in the linked to Manual.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.