jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaarle Kaila <kaarle.ka...@iki.fi>
Subject Re: Jsp Test Example?
Date Wed, 21 Aug 2002 20:57:21 GMT
On Wednesday 21 August 2002 23:00, Wang, Kevin wrote:
> Does anyone have an example for testing Jsps? I looked over the examples
> but could not find any.
>

I think that as you are using Java beans (controller classes) you should
concentrate your test cases on those. Perhaps they can even be tested by
just standard junit testcases.

As JSP is a mix of html and Java I think it is hard to write any sensible 
testcases for them. In my opinion you should concentrate your business logic 
to your beans and / or custom taglibraries and use Java scriptlets only
scarcely. You can test beans with junit or cactus testcases and taglibraries 
with cactus and have a visual test on the jsp-page.

I wrote something on this in a simple application that you can see in 
http://kacoma.sourceforge.net.

regards
Kaarle Kaila


> The jsp is the view in our model. A servlet would populate the "bean"
> object and put in request and forward it to the jsp. The jsp would have the
> following:
>
> <jsp:useBean id="bean" class="Bean" scope="request" />
> <%@ include file="../another.jsp" %>
> <%= bean.getName() %>
> ...
>
> How would one test the jsp using Cactus in this case?
>
> Thanks.
> Kevin

-- 
Kaarle Kaila
mailto:kaarle.kaila@iki.fi
http://www.iki.fi/kaila
tel: 050 3725844


--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message