struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emil Alexandrov" <Emil.Alexand...@rila.com>
Subject RE: Struts and Constants ?
Date Mon, 28 Jul 2003 14:09:12 GMT
10x 4 the answer,
But this 'pure' templates without scriplets have some disadvantages as we see then. And this
thing about HTML designers that don't have to know Java is yet another book rule that is not
one to one with reality. It's true that designers don't have to know Java and they design
in HTML but after I as a developer put some 'tags' in html it's the same confusion for them
whether this tags are like < %=something%> or <bean:write name="name" property="prop"/>.

Just my thoughts, may be I'm wrong.
10x once again

-----Original Message-----
From: Bailey, Shane C. [mailto:SHANE.C.BAILEY@saic.com] 
Sent: 28 Юли 2003 г. 16:32
To: 'Struts Users Mailing List'
Subject: RE: Struts and Constants ?



They (the authors) are just trying to show code without any scriptlets because that would
be a "no no".  But, like the example already posted in response to your question, using <bean:write
name="<%= IConstants.SOME_CONST %>" ...> would be the equivalent way to use a constant
in your tags.

It's just not as pretty plus your html developers don't need to know Java when you go without
the scriptlets.

Using <%= IConst.SOME_CONST %> you'll need to have to have this at the top of the JSP:
<%@ page import="whatever.package.IConst" %> or you can do: 
<%= whatever.package.IConst.SOME_CONST %>



-----Original Message-----
From: Emil Alexandrov [mailto:Emil.Alexandrov@rila.com] 
Sent: Monday, July 28, 2003 9:13 AM
To: struts-user@jakarta.apache.org
Subject: Struts and Constants ?

Hi,
I'm new in Struts and I'm trying to catch up with Chuck's Jakarta Struts but I must confess
that I'm a little confused with the use of Constants in Struts. In the examples in the book
when we pass some data from controller to view we use something like (session,request).setAttribute(IConstants.SOME_CONST,
someObj) where for example SOME_CONST="blah blah" What puzzles me is that in the jsp when
we want to show the object we use 
<bean:write name="blah blah" property="someProperty"/>
The same examples I saw and in 'Struts Kick Start'. So what is the use of the Constant? If
we change the constant we have to go and manually change the value of the constant in jsp
too! Am I missing something, or just examples are not complete?

10x,
Emil

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message