I just read the Manning book on Struts 2 and understand the theory behind
Struts but am a little bit confused as to how to actually implement my first
app in practice. The locations of the config files, etc are a little
confusing.
For my development environment I'm using Maven 2 + Ecplise IDE.
Ryan,
I just went through a similar learning process. I found that by
following the model of the online tutorial, I had a lot more luck
getting started than trying to start from scratch.
Load up the WTP plugins for Eclipse, grab the quickstart zip file
mentioned in the online tutorial, and
Thank you for the reply.
1. I want to say yes, Feature is a proper JavaBean, with essentials
public class Feature {
private boolean premium;
public void setPremium(boolean b) { premium = b; }
public boolean isPremium(){ return premium; }
}
and no overloaded methods.
features is
On 15Nov, Mark Petrovic wrote:
c:when test=${feature.premium == true}
Should just be c:when test=${feature.premium}
Sorry. I failed to mention in my reply that I tried this, too, and it
made no difference in the html output.
Mark S Petrovic wrote:
which isn't even iterating over the list items. E.g, I get one line of
html output for the c:out value=${feature.premium}/ tag, containing
the string literal '${feature.premium}' in quotes - as if expansion of
${feature.premium} is not taking place.
You're using the
On 15Nov, Dave Newton wrote:
Mark S Petrovic wrote:
which isn't even iterating over the list items. E.g, I get one line of
html output for the c:out value=${feature.premium}/ tag, containing
the string literal '${feature.premium}' in quotes - as if expansion of
${feature.premium} is not
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags
are copied directly into the html output, with the browser doing its
best to just ignore them. The plaintext tag
Mark S Petrovic wrote:
Whatever is misconfigured in my app is not a completely fatal situation:
I just can't get at the scripting variables to do meaningful operations
on them.
Can you set a String into scope:
request.setAttribute(foo, bar);
then in a JSP do:
c:out value=${foo}/
?
Dave
On 11/15/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags
are copied directly into the html output, with the browser
To: Struts Users Mailing List
Subject: Re: Newbie help with Struts idiom: functional if/else tags
I know I'll look back on this learning curve with a head-slapping
recollection, but until then, for posterity:
1. If I remove the taglib directive in the JSP, the various c: tags are
copied directly
Good day. I am new to Struts, and while I am coming up to speed, I'm
still struggling with what are surely common idioms.
In a JSP, I want to output, say, a td element body conditionally based
on a given bean property.
In pseudocode, I want
if bean.property == true
print td X /td
else
Use either Struts logic:equal or JSTL c:if or bare scriptlet. In
your particular case you can make the decision in the bean itself. Do
not print HTML tags from Java, this produces unmaintable and
unportable code.
Michael.
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
Good day. I am new
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
Good day. I am new to Struts, and while I am coming up to speed, I'm
still struggling with what are surely common idioms.
In a JSP, I want to output, say, a td element body conditionally based
on a given bean property.
In pseudocode, I
Thank you for the reply.
Using, for example, logic:equal seems to solve only half the problem.
Using logic:equal, I can see my way clear to
logic:equal name=feature property=premium value=true
tdTrue/a
/logic:equal
logic:notEqual name=feature property=premium value=true
tdTrue/a
I like this:
c:choose
c:when test=${bean.property}true/c:when
/c:choose
Larry
On 11/14/05, Michael Jouravlev [EMAIL PROTECTED] wrote:
Use either Struts logic:equal or JSTL c:if or bare scriptlet. In
your particular case you can make the decision in the bean itself. Do
not print HTML tags
I'm still stumbling on some details.
For
logic:iterate id=feature name=features
tr
td
c:choose
c:when test=${feature.premium == true}
c:out value=true/
/c:when
c:otherwise
c:out value=false/
On 11/14/05, Mark S Petrovic [EMAIL PROTECTED] wrote:
c:when test=${feature.premium == true}
Should just be c:when test=${feature.premium}
Is 'feature' a proper JavaBean? The types for get(is)/set methods
match, no overloaded set methods, etc?
--
Wendy
On 7/6/05, Frasso, Anthony [EMAIL PROTECTED] wrote:
Thanks for your help, Rahul. My current web.xml file looks like this:
?xml version=1.0?
!DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
Frasso, Anthony wrote the following on 7/5/2005 5:34 PM:
%
ProjectsBean projectsBean = new ProjectsBean();
projectsBean.populate();
pageContext.setAttribute(pojectsBean, projectsBean);
%
Any scope should work. Also make sure the Project object includes the
appropriate (JavaBeans
On 7/6/05, Frasso, Anthony [EMAIL PROTECTED] wrote:
snip/
Instead of doing what I would expect, it prints out the the text of
$(project.projectId} instead of its value.
Note that I also tried using your JSP 2.0 recommendation, replacing the
c:out tag with just ${project.projectId}. Same
Thanks for your help, Rahul. My current web.xml file looks like this:
?xml version=1.0?
!DOCTYPE web-app PUBLIC
-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
...
According to the wiki, it seems that I should
Hello, and thanks in advance for your help.
I am a newbie with respect to struts, and for that matter web development in
general. I am attempting to design a simple jsp page (using the struts
framework) to print a table of values that are read from a bean. For now, I'll
stick to trying to
Frasso, Anthony wrote the following on 7/5/2005 5:34 PM:
Hello, and thanks in advance for your help.
I am a newbie with respect to struts, and for that matter web development in
general. I am attempting to design a simple jsp page (using the struts
framework) to print a table of values that
Anthony,
I'm still a newbie to struts myself, so take this email with a gain of
salt (or 2). I put in a suggestion down below that may make your life
easier if you have a lot of reports to deliver (or similiar items on
what you are displaying).
-- Start JSP Code
%
ProjectsBean
What is it doing wrong? Getting errors? What does the resulting html src
code look like?
George Sexton wrote the following on 3/24/2005 10:45 PM:
I'm running into a problem with Struts, and I admit I'm a newbie to it.
I have a line in a JSP file:
html:text property=event_date_fmt /
What I'd like
It's possible you just need to update your taglib declarations to use
the EL version of the tags.
Hubert
On Fri, 25 Mar 2005 11:41:41 -0500, Rick Reumann [EMAIL PROTECTED] wrote:
What is it doing wrong? Getting errors? What does the resulting html src
code look like?
George Sexton wrote
The readonly attribute is not output.
George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
-Original Message-
From: Rick Reumann [mailto:[EMAIL PROTECTED]
Sent: Friday, March 25, 2005 9:42 AM
To: Struts Users Mailing List
Subject: Re: Newbie Help
PROTECTED]
Sent: Friday, March 25, 2005 9:45 AM
To: Struts Users Mailing List
Subject: Re: Newbie Help html:text conditional arguments
It's possible you just need to update your taglib declarations to use
the EL version of the tags.
Hubert
On Fri, 25 Mar 2005 11:41:41 -0500, Rick
: RE: Newbie Help html:text conditional arguments
How would I do this? I upgraded all of the jars to 1.2.4
version of struts,
and copied the TLDs and DTDs, but the READONLY attribute is
still not set.
George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
OK, I found it and that works.
George Sexton
MH Software, Inc.
http://www.mhsoftware.com/
Voice: 303 438 9585
-Original Message-
From: George Sexton [mailto:[EMAIL PROTECTED]
Sent: Friday, March 25, 2005 10:45 AM
To: 'Struts Users Mailing List'
Subject: RE: Newbie Help
I'm running into a problem with Struts, and I admit I'm a newbie to it.
I have a line in a JSP file:
html:text property=event_date_fmt /
What I'd like to do is conditionally have readonly set:
%
request.setAttribute(my_attr,true);
%
html:text readonly=${my_attr} property=event_date_fmt /
But
31 matches
Mail list logo