Reputation: 12732
First, some background:
I will have to work on code for a JSP that will demand a lot of code fixing and testing. This JSP will receive a structure of given objects, and render it according to a couple of rules.
What I would like to do, is to write a "Test Server" that would read some mock data out of a fixtures file, and mock those objects into a factory that would be used by the JSP in question.
The target App Server is WebSphere and I would like to code, change, code in order to test appropriate HTML rendering. I have done something similar on the past, but the JSP part was just calling a method on a rendering object, so I created an Ad Hoc HTTP server that would read the fixture files, parse it and render HTML.
All I had to do was run it inside RAD, change the HTML code and hit F5.
So question pretty much goes down to: Is there any stand alone library or lightweight server (I thought of Jetty) that would take a JSP, and given the correct contexts (Request, Response, Session, etc.) render the proper HTML?
Upvotes: 2
Views: 4213
Reputation: 308938
You need more than a web server. You've got to have a servlet/JSP engine, so there's no getting around that.
Jetty's quite light. Maybe Resin deserves a look, too.
Upvotes: 2
Reputation: 5781
I've never used JSPs, but I have played around with OOWeb. It's definitely lightweight, and follows the request/response model, but you'll be hard pressed to connect it with your JSPs without a lot of glue.
A couple lightweight containers are listed here. It looks like Tiny Java Web Server in particular is actively being developed. Unfortunately there's not much documentation available for it.
Upvotes: 0
Reputation: 199264
There is none ( afaik ) .
The only workaround I could suggest is to use Velocity instead. But, of course you would have to resign to jsp altogether and that could not the an option.
IF you do then you can isolate your test with Velocity move the result into a web.
Here's an article on how to use Velocity + Ruby ( or JRuby ) for an standalone solution.
http://martinfowler.com/bliki/JRubyVelocity.html
Upvotes: 0
Reputation: 4645
jetty and tomcat
those may be not light enough for your tastes though.
you'll find plenty of users and support on SO for tomcat, so that counts for something.
Upvotes: 0