在没有App/Web服务器的情况下呈现JSP页面的简便方法是什么 [英] What would be the light way to render a JSP page without an App/Web Server

查看:86
本文介绍了在没有App/Web服务器的情况下呈现JSP页面的简便方法是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,一些背景知识:

我将不得不为需要大量代码修复和测试的JSP编写代码.该JSP将接收给定对象的结构,并根据一些规则对其进行渲染.

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.

我想做的是编写一个测试服务器",该服务器将从fixtures文件中读取一些模拟数据,并将这些对象模拟到有问题的JSP使用的工厂中.

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.

目标App Server是WebSphere,我想编写代码,进行更改以测试适当的HTML呈现.我过去做过类似的事情,但JSP部分只是在渲染对象上调用方法,因此我创建了一个Ad Hoc HTTP服务器,该服务器可以读取Fixture文件,对其进行解析并呈现HTML.

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.

我要做的就是在RAD中运行它,更改HTML代码并点击F5.

All I had to do was run it inside RAD, change the HTML code and hit F5.

所以问题几乎可以归结为:是否有任何独立的库或轻量级服务器(我想到了Jetty)采用JSP,并具有正确的上下文(请求,响应,会话)等)呈现正确的HTML?

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?

推荐答案

我从没有使用过JSP,但是我已经

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.

此处列出了几个轻量级容器.似乎正在积极开发小型Java Web服务器.不幸的是,没有太多可用的文档.

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.

这篇关于在没有App/Web服务器的情况下呈现JSP页面的简便方法是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆