In the struts-example that comes with stuts 1.0 they use a tag for this.
I can imagine however that some people find creating their own taglib
for such a trivial task a bit too much work.
-----Original Message-----
From: Marc L. de Bruin [mailto:marc@debruin.org]
Sent: donderdag 1 november 2001 21:48
To: struts-user@jakarta.apache.org
Subject: Check session/BO @ the view without using Java
lo,
I'm a new Struts user (not new on MVC tho). Before starting my own
Struts-based webapp, I thought it would be wise to study some tutorials
first. One of these is
http://www.jspinsider.com/tutorials/jsp/struts/strutsintro.view . It is
the common logon.jsp/homepage.jsp example.
However, I don't feel very comfortable with their resulting MVC, because
they have Java-code within the homepage.jsp to avoid 'deep linking'. It
looks like this:
*/<%@page contentType="text/html"%>/*
*<jsp:useBean **id**=*"User"* scope**=*"session"*
**class**=*"com.jspinsider.struts.User"* />*
*/<% if (User.isActive() == false){%>/*
*<jsp:forward page**=*'logon.jsp'* />*
*/<%}%>/*
*<**html**>
*My question:
- Is this the proper way to do it? I didn't expect Java-code to appear @
the view;
- If not, what is the proper way to accomplish such a result?
Tnx,
Marc.
--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
--
To unsubscribe, e-mail: <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>
|