views:

36

answers:

1

One of the things that's neat about the IIS / ASP.NET environment is the ability to do an "xcopy deployment" - you can literally just drop a stack of .aspx pages in a web-shared directory, and ISS will figure out how to show them to the web.

Is there a way to do something similar with JSPs?

The exact use case in question is this: we have an internal development/debugging tool that would work much better if it was just a JSP or two living on the "back burner" of the web server.

The whole process of creating a JAR and/or WAR files for a single JSP seems like overkill, as does setting up a whole ant build/deployment task. Is there any way to just point the server at a directory with JSPs in it and have it show those?

(For the record, we're using JBoss as our java web server, so solutions with that would bve preferred, but due to the nature of this particular puzzle I'll take any windows-runnable java server you might have in mind.)

+3  A: 

It's almost xcopy :-)

If you truly do have everything you need within your JSP (which is far from ideal but that's outside the scope of this question), the only missing piece of the puzzle is application descriptor located in WEB-INF/web.xml.

And in the simplest scenario, all you need to have within it is root web-app element:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
   version="2.5"> 
</web-app>

If you're using any tag libraries, you'll also need to map their URIs to their local locations. You can xcopy all your JSP files along with this WEB-INF/web.xml into a subfolder of webapps location of your servlet container and, assuming it can automatically detect / deploy webapps (majority of them do) you're all set.

ChssPly76