Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Newbie with servlets and JBoss

 
Sherry Jacob
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

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


Regards
 
Sherry Jacob
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic