aspose file tools*
The moose likes Servlets and the fly likes How attach servlet classfiles.zip into java 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 "How attach servlet classfiles.zip into java" Watch "How attach servlet classfiles.zip into java" New topic
Author

How attach servlet classfiles.zip into java

ee bayar
Greenhorn

Joined: Jan 07, 2009
Posts: 3
Hello I want to use servlet classes but my servlet classes not available in java. So I have to attach servlet classes into my java and use it, how to ... help me !!

Dear en.bayaraa
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61432
    
  67

"bayar bayar", please check your private messages for an important administrative matter.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

ee bayar wrote:Hello I want to use servlet classes but my servlet classes not available in java. So I have to attach servlet classes into my java and use it, how to ... help me !!

Dear en.bayaraa



What do you mean by "servlet classes not available in java"?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Sunil Kumar
Ranch Hand

Joined: Apr 24, 2007
Posts: 76
I think bayer means the servlets's .class files are available (in jar or opened) and not the .java files.
If thats the case, you can use them as a jar, just like other API's available in jars. Or even the open .class files, you just need to copy them in your application (at correct location).


Sunil Kumar
http://goodtoknowit.blogspot.com/
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
hmmm... someplace other than the beginner's forum... maybe servlets?


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
ee bayar
Greenhorn

Joined: Jan 07, 2009
Posts: 3
"servlet classes not available in java" this mean in "C:\Program Files\Java\jdk1.6.0_07\src.zip" that in file`s javax folder don`t contain "servlet" folder. When write import javax.servlet.http in my eclipse .... problem !.
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Java SE doesn't contain the Servlet API.
Java EE does.

So you need Java EE SDK rather than the Java SE JDK.

The Java EE SDK ships with under each Sun Java Application Server (also known as Glassfish) which is a concrete implementation of the Servlet API. The javax.servlet classes are present in its javaee.jar file.

Alternatively (and more recommendable) you can just keep the Java SE and separately download Apache Tomcat which is also a concrete implementation of the Servlet API. The javax.servlet classes are present in its servlet-api.jar file.

Assuming that you're using Eclipse for Java EE (which contains the Web Tools Platform), you can just integrate the application server in it. Go to the servers view, add a new server entry, choose the installed application server (Glassfish or Tomcat or whatever you have installed) and add it. Then you should create a new Dynamic Web Project and associate it with the integrated server. This way Eclipse will take all libraries of the server in the build path (the classpath in Eclipse's terms). Then you should be able to code with the Servlet API!

You can get more information and helpful hints out of this tutorial: http://balusc.blogspot.com/2008/01/jsf-tutorial-with-eclipse-and-tomcat.html You may ignore and skip the JSF part if you aren't going to use it, but you should include the JSTL part as it is extremely useful. With JSTL you can control the flow in JSP pages.
ee bayar
Greenhorn

Joined: Jan 07, 2009
Posts: 3
Thanks a lot , I try it .
stef li
Greenhorn

Joined: Jan 16, 2006
Posts: 27
you can add the j2ee library into your project's classpath.
or add servelt-api.jar into your project's classpath.

This guy is so lazy!!!<br />There is nothing left!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How attach servlet classfiles.zip into java