aspose file tools*
The moose likes Servlets and the fly likes Newbie with servlets and JBoss 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 "Newbie with servlets and JBoss" Watch "Newbie with servlets and JBoss" New topic
Author

Newbie with servlets and JBoss

Sherry Jacob
Ranch Hand

Joined: Jun 29, 2005
Posts: 128
Hi everyone,
I installed java on my system in D:\j2sdk1.4.0_03 and JBoss on D:\jboss-4.0.0.

But I am having a problem compiling servlets.

It says :

validateLogin.java:3: package javax.servlet does not exist
import javax.servlet.*;
^
validateLogin.java:4: package javax.servlet.http does not exist
import javax.servlet.http.*;
^
validateLogin.java:6: cannot resolve symbol
symbol : class HttpServlet
location: class validateLogin
public class validateLogin extends HttpServlet
^
validateLogin.java:8: cannot resolve symbol
symbol : class ServletConfig
location: class validateLogin
public void init(ServletConfig config) throws ServletException
^
validateLogin.java:8: cannot resolve symbol
symbol : class ServletException
location: class validateLogin
public void init(ServletConfig config) throws ServletException
^
validateLogin.java:13: cannot resolve symbol
symbol : class HttpServletRequest
location: class validateLogin
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:13: cannot resolve symbol
symbol : class HttpServletResponse
location: class validateLogin
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:13: cannot resolve symbol
symbol : class ServletException
location: class validateLogin
public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:18: cannot resolve symbol
symbol : class HttpServletRequest
location: class validateLogin
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:18: cannot resolve symbol
symbol : class HttpServletResponse
location: class validateLogin
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:18: cannot resolve symbol
symbol : class ServletException
location: class validateLogin
public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
^
validateLogin.java:10: cannot resolve symbol
symbol : variable super
location: class validateLogin
super.init(config);
^
validateLogin.java:23: cannot resolve symbol
symbol : class RequestDispatcher
location: class validateLogin
RequestDispatcher rd = req.getRequestDispatcher("/index.jsp");
^
validateLogin.java:28: cannot resolve symbol
symbol : class RequestDispatcher
location: class validateLogin
RequestDispatcher rd = req.getRequestDispatcher("/error.jsp");
^
14 errors


What is the problem ?
Where can I find the servlet package ?
If not on my system, then where can I download it ?
Where am I supposed to install the package ?
How am I supposed to configure the CLASSPATH and PATH system variables ?

Please help.


<strong><br />Cheers !!<br /> <br />Sherry<br /></strong><br />[SCJP 1.4]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61417
    
  67

I'm not sure exactly how JBoss lays out its internal Tomcat configuration, but if you poke around you should be able to find a jar file named either servlets.jar or servlet-api.jar (depending upon which Tomcat version it is employing). Add this jar file to your classpath during the compiliation.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
A Kumar
Ranch Hand

Joined: Jul 04, 2004
Posts: 979
Hi,

Check in jboss/server.default/lib...

there are 2 files javax.servlet & javax.servlet.jsp


Regards
Sherry Jacob
Ranch Hand

Joined: Jun 29, 2005
Posts: 128
Originally posted by A Kumar:
Hi,

Check in jboss/server.default/lib...

there are 2 files javax.servlet & javax.servlet.jsp


Regards


Thanks alot...ur advice helped
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie with servlets and JBoss