Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Newbie with servlets and JBoss

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 982
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
roses are red, violets are blue. Some poems rhyme and some are a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic