You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tim Cross <tc...@cinedavis.com> on 2004/07/22 15:22:03 UTC

coupla easy (I hope) beginner questions

Hail gurus!

I've got a jsp page taking a session-context Collection
of forms and displaying it, and I'm trying to add
a delete and an edit link or form on a per-row basis.
Seems like a pretty obvious thing, right? Based on
a tip from this list, I tried the following, after
considerable screwing around with other variants.

The jsp code looks (right now, formatting stripped out) like:

### SNIPPET
<logic:present scope="session" name="allContacts">
<table border="1" cellspacing="2" cellpadding="2">
<logic:iterate id="collectionElement" name="allContacts">
<tr>
<td>
<bean.define id="eltId"><bean:write name="collectionElement"
property="id"/></bean.define>
<html:link
	page="deleteContact.do?id=${eltId}">Delete Contact</html:link>
</td>
<td><bean:write name="collectionElement" property="salutation"/></td>
<td><bean:write name="collectionElement" property="firstName"/></td>
...
### !SNIPPET

and the generated HTML looks (right now, formatting stripped out) like:

### SNIPPET
<table border="1" cellspacing="2" cellpadding="2">
<tr>
<td>
<bean.define id="eltId">e682d6b47f00000101616dd681dc2378</bean.define>
<a href="deleteContact.do?id=${eltId}">Delete Contact</a>
</td>
<td>mr</td>
<td>tim</td>
...
### !SNIPPET

The first beginner question (I've been working in C and SQL and
POJO Java for many years, but I'm very green at all this Web/app server
stuff): How do I get the eltId from the bean:define into the param
for deleteContact.do?

Obviously, with JSTL's c:set, right? Which brings us to the second
beginner question: Has anybody been able to use JSTL in an Eclipse 3.0/
JBoss 3.2.3/JBoss IDE environment? I locate the jars and TLD files
correctly and include the TLDs in web.xml (via taglibs.xml) correctly,
but on deployment of the EAR I get a error along the lines of:

Document root element "taglib", must match DOCTYPE root "null"

about the c.tld file itself (and similarly for all the other JSTL
tag files). I read something on the web about hacking my web.xml
file to be 2.4 instead of 2.3 (and some other stuff you have to
do to the web.xml DOCTYPE declaration). Since web.xml is completely
generated in this environment, that's not a real fix, but I tried it
anyway, and the results were the same. I've tried this will all of
c.tld, c-1_0.tld and c-1_0-rt.tld. Anyone? Anyone? Bueller?

Many thanks to anyone who can smarten up this chump.

Tim
tcross@cineNOSPAMdavis.com
www.cinedavis.com
Dresden, Germany




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


R: coupla easy (I hope) beginner questions

Posted by Amleto Di Salle <di...@di.univaq.it>.
Hi,
Is "bean.define" correct?
Anyway you have to use <bean:define ...> and </bean:define>.

Furthermore, in order to use the Struts tag without the el-extension
(you can find them in the "contrib" directory inside the Struts 1.1
binary release) you have to use a 2.4 servlet (and jsp 2.0)
Web-container compliant (for example Tomcat 5.0.x) and JSTL1.1.


BR
Amleto



-----Messaggio originale-----
Da: Robert Taylor [mailto:rtaylor@mulework.com] 
Inviato: giovedì 22 luglio 2004 15.33
A: Struts Users Mailing List
Oggetto: RE: coupla easy (I hope) beginner questions


I'm no guru, but....


You can put the appropriate HTML stuff in, but
the basics are as follows:

<logic:iterate id="collectionElement" name="allContacts"> <html:link
action="/deleteContact" 
           paramId="id" 
           paramName="collectionElement" 
           paramProperty="eltId"/>
</logic:iterate>

Sorry, can't help you with your second question :(

robert

> -----Original Message-----
> From: Tim Cross [mailto:tcross@cinedavis.com]
> Sent: Thursday, July 22, 2004 9:22 AM
> To: user@struts.apache.org
> Subject: coupla easy (I hope) beginner questions
> 
> 
> Hail gurus!
> 
> I've got a jsp page taking a session-context Collection
> of forms and displaying it, and I'm trying to add
> a delete and an edit link or form on a per-row basis.
> Seems like a pretty obvious thing, right? Based on
> a tip from this list, I tried the following, after considerable 
> screwing around with other variants.
> 
> The jsp code looks (right now, formatting stripped out) like:
> 
> ### SNIPPET
> <logic:present scope="session" name="allContacts">
> <table border="1" cellspacing="2" cellpadding="2"> <logic:iterate 
> id="collectionElement" name="allContacts"> <tr>
> <td>
> <bean.define id="eltId"><bean:write name="collectionElement"
> property="id"/></bean.define>
> <html:link
> 	page="deleteContact.do?id=${eltId}">Delete Contact</html:link>
> </td>
> <td><bean:write name="collectionElement" property="salutation"/></td>
> <td><bean:write name="collectionElement" property="firstName"/></td>
> ...
> ### !SNIPPET
> 
> and the generated HTML looks (right now, formatting stripped out) 
> like:
> 
> ### SNIPPET
> <table border="1" cellspacing="2" cellpadding="2">
> <tr>
> <td>
> <bean.define id="eltId">e682d6b47f00000101616dd681dc2378</bean.define>
> <a href="deleteContact.do?id=${eltId}">Delete Contact</a> </td>
> <td>mr</td>
> <td>tim</td>
> ...
> ### !SNIPPET
> 
> The first beginner question (I've been working in C and SQL and POJO 
> Java for many years, but I'm very green at all this Web/app server
> stuff): How do I get the eltId from the bean:define into the param for

> deleteContact.do?
> 
> Obviously, with JSTL's c:set, right? Which brings us to the second 
> beginner question: Has anybody been able to use JSTL in an Eclipse 
> 3.0/ JBoss 3.2.3/JBoss IDE environment? I locate the jars and TLD 
> files correctly and include the TLDs in web.xml (via taglibs.xml) 
> correctly, but on deployment of the EAR I get a error along the lines 
> of:
> 
> Document root element "taglib", must match DOCTYPE root "null"
> 
> about the c.tld file itself (and similarly for all the other JSTL tag 
> files). I read something on the web about hacking my web.xml file to 
> be 2.4 instead of 2.3 (and some other stuff you have to do to the 
> web.xml DOCTYPE declaration). Since web.xml is completely generated in

> this environment, that's not a real fix, but I tried it anyway, and 
> the results were the same. I've tried this will all of c.tld, 
> c-1_0.tld and c-1_0-rt.tld. Anyone? Anyone? Bueller?
> 
> Many thanks to anyone who can smarten up this chump.
> 
> Tim
> tcross@cineNOSPAMdavis.com
> www.cinedavis.com
> Dresden, Germany
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

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


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


RE: coupla easy (I hope) beginner questions

Posted by Robert Taylor <rt...@mulework.com>.
I'm no guru, but....


You can put the appropriate HTML stuff in, but
the basics are as follows:

<logic:iterate id="collectionElement" name="allContacts">
<html:link action="/deleteContact" 
           paramId="id" 
           paramName="collectionElement" 
           paramProperty="eltId"/>
</logic:iterate>

Sorry, can't help you with your second question :(

robert

> -----Original Message-----
> From: Tim Cross [mailto:tcross@cinedavis.com]
> Sent: Thursday, July 22, 2004 9:22 AM
> To: user@struts.apache.org
> Subject: coupla easy (I hope) beginner questions
> 
> 
> Hail gurus!
> 
> I've got a jsp page taking a session-context Collection
> of forms and displaying it, and I'm trying to add
> a delete and an edit link or form on a per-row basis.
> Seems like a pretty obvious thing, right? Based on
> a tip from this list, I tried the following, after
> considerable screwing around with other variants.
> 
> The jsp code looks (right now, formatting stripped out) like:
> 
> ### SNIPPET
> <logic:present scope="session" name="allContacts">
> <table border="1" cellspacing="2" cellpadding="2">
> <logic:iterate id="collectionElement" name="allContacts">
> <tr>
> <td>
> <bean.define id="eltId"><bean:write name="collectionElement"
> property="id"/></bean.define>
> <html:link
> 	page="deleteContact.do?id=${eltId}">Delete Contact</html:link>
> </td>
> <td><bean:write name="collectionElement" property="salutation"/></td>
> <td><bean:write name="collectionElement" property="firstName"/></td>
> ...
> ### !SNIPPET
> 
> and the generated HTML looks (right now, formatting stripped out) like:
> 
> ### SNIPPET
> <table border="1" cellspacing="2" cellpadding="2">
> <tr>
> <td>
> <bean.define id="eltId">e682d6b47f00000101616dd681dc2378</bean.define>
> <a href="deleteContact.do?id=${eltId}">Delete Contact</a>
> </td>
> <td>mr</td>
> <td>tim</td>
> ...
> ### !SNIPPET
> 
> The first beginner question (I've been working in C and SQL and
> POJO Java for many years, but I'm very green at all this Web/app server
> stuff): How do I get the eltId from the bean:define into the param
> for deleteContact.do?
> 
> Obviously, with JSTL's c:set, right? Which brings us to the second
> beginner question: Has anybody been able to use JSTL in an Eclipse 3.0/
> JBoss 3.2.3/JBoss IDE environment? I locate the jars and TLD files
> correctly and include the TLDs in web.xml (via taglibs.xml) correctly,
> but on deployment of the EAR I get a error along the lines of:
> 
> Document root element "taglib", must match DOCTYPE root "null"
> 
> about the c.tld file itself (and similarly for all the other JSTL
> tag files). I read something on the web about hacking my web.xml
> file to be 2.4 instead of 2.3 (and some other stuff you have to
> do to the web.xml DOCTYPE declaration). Since web.xml is completely
> generated in this environment, that's not a real fix, but I tried it
> anyway, and the results were the same. I've tried this will all of
> c.tld, c-1_0.tld and c-1_0-rt.tld. Anyone? Anyone? Bueller?
> 
> Many thanks to anyone who can smarten up this chump.
> 
> Tim
> tcross@cineNOSPAMdavis.com
> www.cinedavis.com
> Dresden, Germany
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

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