This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes create a new servlet in struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "create a new servlet in struts" Watch "create a new servlet in struts" New topic
Author

create a new servlet in struts

pingkan paula
Ranch Hand

Joined: Sep 03, 2004
Posts: 117
I'm new to struts and I want to create a new servlet which will print jsp pages into PDF format. My question is, do i have to put the servlet code in /lib directory or can I just place it in the source directory?
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
As long as you declare the servlet in your web.xml file, the class files can be anywhere in your class path. That means they could either be in a jar file in the WEB-INF/lib directory, or they could be in WEB-INF/classes along with all your other classes.

Something you might want to consider would be to put this functionality in a Struts Action rather than a servlet. An Action can do pretty much anything a servlet can do, and using Actions rather than Servlets in a Struts application is a more consistent architectural choice.


Merrill
Consultant, Sima Solutions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: create a new servlet in struts
 
Similar Threads
struts blank.war
Uploaded file's default location
Connecting an applet to my struts data
Setting classpath in iPlanet 4.1
struts