RV: struts1 - html:hidden tag
2) actually assigns the value 1) gets the value of the property from the formbean if it has been assigned in the formbean. You may have an action that populates the form by hitting a database, loading the data in the form and the forwarding to your current page ie before editing a record. mas Emi Lu wrote: Good morning, A question about struts1 html:hidden tag. May I know the differences between (1) vs. (2) please? (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. Could someone let me know why? I am lost why default value will cause problem. Thanks a lot --- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 mark.shif...@yale.edu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts1 - html:hidden tag
Good morning, A question about struts1 html:hidden tag. May I know the differences between (1) vs. (2) please? (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. Could someone let me know why? I am lost why default value will cause problem. Thanks a lot --- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: struts1 - html:hidden tag
It's while return value in operation en ActionStrust y parameter in IN -Mensaje original- De: Emi Lu [mailto:em...@encs.concordia.ca] Enviado el: Jueves, 05 de Marzo de 2009 10:18 a.m. Para: Struts Users Mailing List Asunto: struts1 - html:hidden tag Good morning, A question about struts1 html:hidden tag. May I know the differences between (1) vs. (2) please? (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. Could someone let me know why? I am lost why default value will cause problem. Thanks a lot --- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts1 - html:hidden tag
2) actually assigns the value 1) gets the value of the property from the formbean if it has been assigned in the formbean. You may have an action that populates the form by hitting a database, loading the data in the form and the forwarding to your current page ie before editing a record. mas Emi Lu wrote: Good morning, A question about struts1 html:hidden tag. May I know the differences between (1) vs. (2) please? (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. Could someone let me know why? I am lost why default value will cause problem. Thanks a lot --- Lu Ying - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 mark.shif...@yale.edu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts1 - html:hidden tag
Hi Mas, 2) actually assigns the value 1) gets the value of the property from the formbean if it has been assigned in the formbean. You may have an action that populates the form by hitting a database, loading the data in the form and the forwarding to your current page ie before editing a record. If I'd like to load value from datasources into , in my jsp file, (1) should always be used; otherwise, (2) will rewritten the form value to ? Thanks, -- Lu Ying (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts1 - html:hidden tag
I am not really sure what you are doing?? If you need a datasource and have set it up appropriately in your context.xml see http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.html(for tomcat 6.0) you get the datasource doing something like this: Context initContext = new InitialContext(); Context envContext = (Context)initContext.lookup(java:/comp/env); DataSource ds = (DataSource)envContext.lookup(jdbc/myoracle); in an action. You don't need to have a datasource as a hidden field. mas Hi Mas, 2) actually assigns the value 1) gets the value of the property from the formbean if it has been assigned in the formbean. You may have an action that populates the form by hitting a database, loading the data in the form and the forwarding to your current page ie before editing a record. If I'd like to load value from datasources into , in my jsp file, (1) should always be used; otherwise, (2) will rewritten the form value to ? Thanks, -- Lu Ying (1)html:hidden property=field1 / (2)html:hidden property=field1 value= / When I load value from popup windows, it seems that default value will be setup on (1); while (2) always return value=. -- Mark Shifman MD. Ph.D. Yale Center for Medical Informatics Phone (203)737-5219 mark.shif...@yale.edu - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts1 - html:hidden tag
Emi Lu wrote: 2) actually assigns the value 1) gets the value of the property from the formbean if it has been assigned in the formbean. You may have an action that populates the form by hitting a database, loading the data in the form and the forwarding to your current page ie before editing a record. If I'd like to load value from datasources into , in my jsp file, (1) should always be used; otherwise, (2) will rewritten the form value to ? Yes, in (2) you're explicitly setting the value--if you're setting it to what's contained in field1 then leave off the value attribute, which it seems like you were doing, or use something besides a blank for the value. Dave - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: A tile definition. I've tried a few combinations, but none is working. For example if I use action path=/home type=be.fedict.etendering.web.actions.common.HomeAction forward name=home path=home redirect=true / /action I get no exception but a blank page is returned. I suppose that Tiles has not been configured correctly then. See: http://wiki.apache.org/struts/StrutsUpgradeNotes12to13 In particular, in the Tiles part: Add a chainConfig init-param in the web.xml pointing to the location of the chain-config.xml init-param param-namechainConfig/param-name param-valueorg/apache/struts/tiles/chain-config.xml/param-value /init-param HTH Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Still no luck. #*$#$!@(*$ strus :) Anyway here's what I've done so far. Patch xdoclet 1.2.3 from http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel to allow xdoclet to create files for struts 1.3. Updated commons-chain.jar to 1.2, commons-io.jar to 1.4. Added the init-param you said. Even though no exception is seen in the logs, I get a 500 Internal server error when trying to access the home page. Here's my web.xml related part: servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namechainConfig/param-name param-valueorg/apache/struts/tiles/chain-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-nameapplication/param-name param-valueApplicationResources/param-value /init-param load-on-startup1/load-on-startup /servlet ...and here's the end of struts-config.xml: !-- Define your Struts controller in a file called struts-controller.xml and place it in your merge directory. -- message-resources parameter=ApplicationResources / message-resources parameter=ApplicationResourcesErrorMessages key=ERROR_RESOURCE_KEY / message-resources parameter=ApplicationResourcesHelpMessages key=HELP_RESOURCE_KEY / plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / set-property property=definitions-debug value=1/ set-property property=definitions-parser-validate value=true / set-property property=moduleAware value=true / set-property property=definitions-parser-details value=2/ /plug-in plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ set-property property=stopOnFirstError value=true / /plug-in /struts-config See anything wrong? Regards Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: I get a 500 Internal server error when trying to access the home page. Can I see the stack trace? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: I get a 500 Internal server error when trying to access the home page. Can I see the stack trace? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Hm, I think we're getting close. A colleague helped me. We had an ErrorHandlerServlet which was eating the exception. Now I get a meaningful 500: 500 Internal Server Error OracleJSP: oracle.jsp.parse.JspParseException: /WEB-INF/jsp/common/layout.jsp: Line # 2, %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=t % Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles Take a look at my changed layout.jsp: %@ page contentType=text/html;charset=utf-8% %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles % %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% tiles:useAttribute name=title / !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd; . But why can't it find the tiles uri? I've included the struts-tiles-1.3.8.jar. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: OracleJSP: oracle.jsp.parse.JspParseException: /WEB-INF/jsp/common/layout.jsp: Line # 2, %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=t % Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles ... But why can't it find the tiles uri? I've included the struts-tiles-1.3.8.jar. Probably it is a caching problem (in Tomcat happens when you change libraries). Try cleaning up the work directory (I don't really know where it is in OC4J, sorry). Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: OracleJSP: oracle.jsp.parse.JspParseException: /WEB-INF/jsp/common/layout.jsp: Line # 2, %@ taglib uri=http://struts.apache.org/tags-tiles; prefix=t % Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles ... But why can't it find the tiles uri? I've included the struts-tiles-1.3.8.jar. Probably it is a caching problem (in Tomcat happens when you change libraries). Try cleaning up the work directory (I don't really know where it is in OC4J, sorry). Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] So, since they're in the jars I don't need to declare the tld's in web.xml right? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: So, since they're in the jars I don't need to declare the tld's in web.xml right? Right, in fact I'm struggling to understand what is the problem, too :-D Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: So, since they're in the jars I don't need to declare the tld's in web.xml right? Right, in fact I'm struggling to understand what is the problem, too :-D Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Could it be that oc4j is not loading the tld's from the jars? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: Antonio Petrelli wrote: 2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: So, since they're in the jars I don't need to declare the tld's in web.xml right? Right, in fact I'm struggling to understand what is the problem, too :-D Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Could it be that oc4j is not loading the tld's from the jars? I don't think so, since you can use the other Struts tags correctly or not? Check it out. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Well, one solution is to move the tld's to a directory and define them in web.xml. This seems to be working. However I've got some strange problems. For example in a tile I render a link for advanced search: %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% %--bean:define id=currentDate name=java.util.Date type=java.util.Date /--% jsp:useBean id=curDate class=java.util.Date / div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search /:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option/select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link %--a href=#Advanced Search/a--% /p /form /div!-- Search -- and I get javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/common/search.jsp': null at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133) [SRC:/WEB-INF/jsp/common/layout.jsp:80] I know it's the link, because if I comment it out I get an exception on a different jsp and the tile shows up. I've also testet bean:message outside the link and it works. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Dimitris Mouchritsas wrote: Well, one solution is to move the tld's to a directory and define them in web.xml. This seems to be working. However I've got some strange problems. For example in a tile I render a link for advanced search: %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% %--bean:define id=currentDate name=java.util.Date type=java.util.Date /--% jsp:useBean id=curDate class=java.util.Date / div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search /:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option/select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link %--a href=#Advanced Search/a--% /p /form /div!-- Search -- and I get javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/common/search.jsp': null at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133) [SRC:/WEB-INF/jsp/common/layout.jsp:80] I know it's the link, because if I comment it out I get an exception on a different jsp and the tile shows up. I've also testet bean:message outside the link and it works. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] BTW is there an option in struts-config.xml (for v.1.3.8 at least) or somewhere else to notify struts to use xhtml compatible elements everywhere? So as to avoid having html:xhtml / in every jsp? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]: BTW is there an option in struts-config.xml (for v.1.3.8 at least) or somewhere else to notify struts to use xhtml compatible elements everywhere? So as to avoid having html:xhtml / in every jsp? I think you have to start a new thread, or no one will notice your question. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Dimitris Congratulations..I think You found a bug /WEB-INF/struts-config.xml /WEB-INF/classes/ApplicationResources.properties prompt.search=Search prompt.Greece=Greece prompt.advanced.search=AdvancedSearch html head %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% /head body bean:define id=curDate value=01-01-1970/ div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search/:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option /select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link a href=#Advanced Search/a /p /form /div /body /html displays properly..if I change - Original Message - From: Dimitris Mouchritsas [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, June 24, 2008 9:17 AM Subject: Re: Closing tag for html:hidden Dimitris Mouchritsas wrote: Well, one solution is to move the tld's to a directory and define them in web.xml. This seems to be working. However I've got some strange problems. For example in a tile I render a link for advanced search: %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% %--bean:define id=currentDate name=java.util.Date type=java.util.Date /--% jsp:useBean id=curDate class=java.util.Date / div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search /:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option/select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link %--a href=#Advanced Search/a--% /p /form /div!-- Search -- and I get javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/common/search.jsp': null at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133) [SRC:/WEB-INF/jsp/common/layout.jsp:80] I know it's the link, because if I comment it out I get an exception on a different jsp and the tile shows up. I've also testet bean:message outside the link and it works. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] BTW is there an option in struts-config.xml (for v.1.3.8 at least) or somewhere else to notify struts to use xhtml compatible elements everywhere? So as to avoid having html:xhtml / in every jsp? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Martin wrote: Dimitris Congratulations..I think You found a bug /WEB-INF/struts-config.xml /WEB-INF/classes/ApplicationResources.properties prompt.search=Search prompt.Greece=Greece prompt.advanced.search=AdvancedSearch html head %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% /head body bean:define id=curDate value=01-01-1970/ div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search/:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option /select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link a href=#Advanced Search/a /p /form /div /body /html displays properly..if I change - Original Message - From: Dimitris Mouchritsas [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, June 24, 2008 9:17 AM Subject: Re: Closing tag for html:hidden Dimitris Mouchritsas wrote: Well, one solution is to move the tld's to a directory and define them in web.xml. This seems to be working. However I've got some strange problems. For example in a tile I render a link for advanced search: %@ taglib uri=http://struts.apache.org/tags-html; prefix=html% %@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean% %--bean:define id=currentDate name=java.util.Date type=java.util.Date /--% jsp:useBean id=curDate class=java.util.Date / div id=Search p class=Time bean:message key=prompt.Greece / bean:write name=curDate format=HH:mm:ss zz / /p form action=# p label for=SearchSelectbean:message key=prompt.search /:/label select name=SearchSelect id=SearchSelect option selected=selectedSelect.../option/select input type=text name=SearchInput id=SearchInput class=Text / input type=submit name=SearchBTN id=SearchBTN class=SearchBTN value=Search / html:link action=prepareAdvancedSearch bean:message key=prompt.advanced.search / /html:link %--a href=#Advanced Search/a--% /p /form /div!-- Search -- and I get javax.servlet.jsp.JspException: ServletException in '/WEB-INF/jsp/common/search.jsp': null at org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465) at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133) [SRC:/WEB-INF/jsp/common/layout.jsp:80] I know it's the link, because if I comment it out I get an exception on a different jsp and the tile shows up. I've also testet bean:message outside the link and it works. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] BTW is there an option in struts-config.xml (for v.1.3.8 at least) or somewhere else to notify struts to use xhtml compatible elements everywhere? So as to avoid having html:xhtml / in every jsp? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The bug report already exists and it's from last year, see: https://issues.apache.org/struts/browse/STR-3015 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Closing tag for html:hidden
Hi all, We're using struts 1.2.4 in our project and we just noticed something; When rendering a html:hidden element the html produced is: input name=id value=1019 type=hidden Notice that it doesn't close the tag properly like / as required by xhtml. Is there a way to tell struts to close properly for xhtml or we have to upgrade? Thanks Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Notice that it doesn't close the tag properly like / as required by xhtml. Is there a way to tell struts to close properly for xhtml or we have to upgrade? Use html:xhtml before the first html:* tag of every JSP page. BTW I suggest to upgrade to Struts 1.2.9 (at least) because html:form in Struts 1.2.4 does not produce XHTML-strict compliant code (in particular it creates the name attribute). Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Notice that it doesn't close the tag properly like / as required by xhtml. Is there a way to tell struts to close properly for xhtml or we have to upgrade? Use html:xhtml before the first html:* tag of every JSP page. BTW I suggest to upgrade to Struts 1.2.9 (at least) because html:form in Struts 1.2.4 does not produce XHTML-strict compliant code (in particular it creates the name attribute). Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Thanks for the info for the form tag. The problem is we use tiles, so html:xhtml is not really an option. A colleague will try to do a controller trick in web.xml, but from what I feel we'll have to upgrade. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Thanks for the info for the form tag. The problem is we use tiles, so html:xhtml is not really an option. Why? html:xhtml / does not produce any markup code, only tells Struts tags to render in XHTML. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Thanks for the info for the form tag. The problem is we use tiles, so html:xhtml is not really an option. Why? html:xhtml / does not produce any markup code, only tells Struts tags to render in XHTML. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Ahh, ok, confused it with html:html xhtml=true which produces the html tag. Anyway, I'm trying to upgrade to struts 1.3.8 but I get an exception when trying to view the first page: null java.lang.NullPointerException at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) at org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96) at org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54) at org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304) at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190) at org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:500) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16) at com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:196) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20) at com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:138) at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20) at com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126) at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534) - etendering 17:15:56.265 DEBUG TilesAccessProxyAction- forwarding to tile definition: error.page etendering 17:15:56.265 DEBUG ErrorHandlerServlet - doGet etendering 17:15:56.265 DEBUG ErrorHandlerServlet - doPost() etendering 17:15:56.265 ERROR ErrorHandlerServlet - RepException id:b5c7ee5ac0a8010101a8cf03a8763d4f etendering 17:15:56.265 ERROR ErrorHandlerServlet - EXCEPTION: - id b5c7ee5ac0a8010101a8cf03a8763d4f, error.generic be.fedict.etendering.exception.EtenderingException: error.generic at be.fedict.etendering.web.servlet.ErrorHandlerServlet.logErrors(ErrorHandlerServlet.java:92) at be.fedict.etendering.web.servlet.ErrorHandlerServlet.doPost(ErrorHandlerServlet.java:53) at be.fedict.etendering.web.servlet.ErrorHandlerServlet.doGet(ErrorHandlerServlet.java:68) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAsPrivileged(Subject.java:500) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) at com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222) at
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Caused by: java.lang.NullPointerException at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) Mmm... Just a shot in the dark, did you put the commons-chain.jar in your classpath? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: Caused by: java.lang.NullPointerException at org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) Mmm... Just a shot in the dark, did you put the commons-chain.jar in your classpath? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Yep, right from the struts lib directory. One thing to note though is we're using xdoclet 1.2.3 to create struts-config.xml for us. As I understand this version of xdoclet supports up to struts 1.2.x. Could this be the culprit? That it doesn't produce a proper struts-config.xml? Because from what I saw web.xml is very similar to 1.3.8's web.xml from the blank web app example. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: One thing to note though is we're using xdoclet 1.2.3 to create struts-config.xml for us. As I understand this version of xdoclet supports up to struts 1.2.x. Could this be the culprit? Probably. According to the source file: http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_8/core/src/main/java/org/apache/struts/chain/commands/servlet/PerformForward.java it seems that a request dispatcher is not found, that is *really* strange, and, IMHO, can only happen when a webapp did not start correctly. Do you see an error at startup? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: One thing to note though is we're using xdoclet 1.2.3 to create struts-config.xml for us. As I understand this version of xdoclet supports up to struts 1.2.x. Could this be the culprit? Probably. According to the source file: http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_8/core/src/main/java/org/apache/struts/chain/commands/servlet/PerformForward.java it seems that a request dispatcher is not found, that is *really* strange, and, IMHO, can only happen when a webapp did not start correctly. Do you see an error at startup? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] No, everything seems to start smoothly. I'll try to create a struts-config.xml file by hand just for the home action and see what happens. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Dimitris Mouchritsas wrote: Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: One thing to note though is we're using xdoclet 1.2.3 to create struts-config.xml for us. As I understand this version of xdoclet supports up to struts 1.2.x. Could this be the culprit? Probably. According to the source file: http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_8/core/src/main/java/org/apache/struts/chain/commands/servlet/PerformForward.java it seems that a request dispatcher is not found, that is *really* strange, and, IMHO, can only happen when a webapp did not start correctly. Do you see an error at startup? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] No, everything seems to start smoothly. I'll try to create a struts-config.xml file by hand just for the home action and see what happens. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] I'm not sure it's the struts-config.xml file anymore. I'm using this: ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.3//EN http://struts.apache.org/dtds/struts-config_1_3.dtd; struts-config !-- Form Bean Definitions -- form-beans /form-beans !-- = Global Exception Definitions -- global-exceptions /global-exceptions !-- === Global Forward Definitions -- global-forwards forward name=welcome path=/Welcome.do/ /global-forwards !-- === Action Mapping Definitions -- action-mappings action path=/Welcome forward=/pages/Welcome.jsp/ action path=/home forward=home / !-- sample input and input submit actions action path=/Input type=org.apache.struts.actions.ForwardAction parameter=/pages/Input.jsp/ action path=/InputSubmit type=app.InputAction name=inputForm scope=request validate=true input=/pages/Input.jsp/ action path=/edit* type=app.Edit{1}Action name=inputForm scope=request validate=true input=/pages/Edit{1}.jsp/ end samples -- /action-mappings !-- Message Resources Definitions -- message-resources parameter=MessageResources / !-- === Plug Ins Configuration -- !-- === Validator plugin -- plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/org/apache/struts/validator/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml / /plug-in /struts-config which is from another 1.3.8 sample app and I just added the action definition for /home. Still I get the same exception. Could it be that it's not finding a proper jar or something? Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: action path=/home forward=home / What exactly is this home? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
Antonio Petrelli wrote: 2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: action path=/home forward=home / What exactly is this home? Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] A tile definition. I've tried a few combinations, but none is working. For example if I use action path=/home type=be.fedict.etendering.web.actions.common.HomeAction forward name=home path=home redirect=true / /action I get no exception but a blank page is returned. Dimitris - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Closing tag for html:hidden
2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]: A tile definition. I've tried a few combinations, but none is working. For example if I use action path=/home type=be.fedict.etendering.web.actions.common.HomeAction forward name=home path=home redirect=true / /action I get no exception but a blank page is returned. I suppose that Tiles has not been configured correctly then. See: http://wiki.apache.org/struts/StrutsUpgradeNotes12to13 In particular, in the Tiles part: Add a chainConfig init-param in the web.xml pointing to the location of the chain-config.xml init-param param-namechainConfig/param-name param-valueorg/apache/struts/tiles/chain-config.xml/param-value /init-param HTH Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden as a collection not String
Shanna7463 wrote: Is it possible to assign a collection to a html:hidden component, rather than a string? Basically my webapp allows the user to select different options for access control. I would like to add these selections to a collection and pass that to my Action class. A hidden input will submit a single string value. To submit a set of values you either need to use multiple hidden inputs (i.e. one per collection entry) or manually marshal the collection into a single string (e.g. a comma separated list of values) the unmarshal it again when it's submitted. Multiple hidden inputs is probably the easier/cleaner approach. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:hidden as a collection not String
Is it possible to assign a collection to a html:hidden component, rather than a string? Basically my webapp allows the user to select different options for access control. I would like to add these selections to a collection and pass that to my Action class. Thanks inadvance!! -- Shanna -- -- View this message in context: http://www.nabble.com/html%3Ahidden-as-a-collection-not-String-tp15312178p15312178.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:hidden
How to assaign value to html:hidden field? html:hidden property=loginid value=%= request.getAttribute(loginid)% but give me the error message, saying need double quote, after i put double quote before %.., cause jsp compile error, any clue? tks in advance john - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta.
Re: html:hidden
On 6/10/07, john lee [EMAIL PROTECTED] wrote: How to assaign value to html:hidden field? html:hidden property=loginid value=%= request.getAttribute(loginid)% but give me the error message, saying need double quote, after i put double quote before %.., cause jsp compile error, Which error did it cause? any clue? tks in advance john - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden
it's because setValue() for the taglib need a String. try html:hidden property=loginid value=%= (String)request.getAttribute(loginid)% Mike john lee a écrit : How to assaign value to html:hidden field? html:hidden property=loginid value=%= request.getAttribute(loginid)% but give me the error message, saying need double quote, after i put double quote before %.., cause jsp compile error, any clue? tks in advance john - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden
Hi, Use plain told HTML and use your script tag. Thanks, Nuwan - Original Message - From: john lee [EMAIL PROTECTED] To: user@struts.apache.org Sent: Sunday, June 10, 2007 3:49 PM Subject: html:hidden How to assaign value to html:hidden field? html:hidden property=loginid value=%= request.getAttribute(loginid)% but give me the error message, saying need double quote, after i put double quote before %.., cause jsp compile error, any clue? tks in advance john - Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
put value to an html:hidden field from a java script function
Hi I need to put value to an input hidden field, from a java script function. I call the java script function from an onclick event of html:submit field I have debuged that process and input hidden field does'nt take value. Always have the default value. This is my way to do this ***This is the java script function* script language=JavaScript function actualizarCampoOcultoRest(forma, campo, valor) { document.forma.campo.value = valor; } /script **This is the call to the function java script html:submit styleClass=botones property=btnEdicion onclick=actualizarCampoOcultoRest(gestionarListadoMonitoresEDHEPForm, campoOcultoRestablecer, '1'); logic:present name=idSeleccionado scope=sessionbean:message key= boton.Actualizar//logic:present logic:notPresent name=idSeleccionado scope=sessionbean:message key=boton.Insertar//logic:notPresent /html:submit *This is the input field*** html:hidden property=campoOcultoRestablecer/ ***In the ActionForm class i declared the input field like this:** private int campoOcultoRestablecer; Always have the default value, 0 if anybody could help me... Thanks
Re: put value to an html:hidden field from a java script function
On 9/21/06, Heidy Gutiérrez Guzmán [EMAIL PROTECTED] wrote: Hi I need to put value to an input hidden field, from a java script function. I call the java script function from an onclick event of html:submit field I have debuged that process and input hidden field does'nt take value. Always have the default value. This is my way to do this ***This is the java script function* script language=JavaScript function actualizarCampoOcultoRest(forma, campo, valor) { document.forma.campo.value = valor; } /script **This is the call to the function java script html:submit styleClass=botones property=btnEdicion onclick=actualizarCampoOcultoRest(gestionarListadoMonitoresEDHEPForm, campoOcultoRestablecer, '1'); The problem is here, this is a javascript error. Your method of sending the form name and parameter name is incorrect. You should probably try and send the id of your hidden field and do the following function setAndSubmit(paramId,paramValue) { document.getElementById(paramId).value = paramValue } You can specify the id this way html:hidden property=foo styleId=hiddenId / html:submit onclick=setAndSubmit('hiddenId','value') / logic:present name=idSeleccionado scope=sessionbean:message key= boton.Actualizar//logic:present logic:notPresent name=idSeleccionado scope=sessionbean:message key=boton.Insertar//logic:notPresent /html:submit *This is the input field*** html:hidden property=campoOcultoRestablecer/ ***In the ActionForm class i declared the input field like this:** private int campoOcultoRestablecer; Always have the default value, 0 if anybody could help me... Thanks -- Puneet
RE: set value to an html:hidden in jsp page
html-el:hidden property=command value=save / the property is just a normal property defined in your form, and you can set a value... or via javascript: function submitForm(var) { self.document.yourform.command.value=var; self.document.yourform.submit(); } html:button onclick=javascript:submitForm('save'); value=Save title=Click to Save... / html:button onclick=javascript:submitForm('add'); value=Add title=Click to Add... / From: Heidy Gutiérrez Guzmán [mailto:[EMAIL PROTECTED] Sent: Sat 16/09/2006 6:49 AM To: Struts Users Mailing List Subject: set value to an html:hidden in jsp page Hi I need to put value to an html:hidden / field in the own page jsp. Thanks ** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
set value to an html:hidden in jsp page
Hi I need to put value to an html:hidden / field in the own page jsp. Thanks
Re: DynaActionForm and html:hidden
document.forms[0][mybean.name].value = myname ; will work [EMAIL PROTECTED] wrote: I haven't tried it, however, I would have to see if JavaScript would handle it. I am updating the hidden field using javascript, so I am not sure if it would like: script language=JavaScript document.forms[0].myBean.name.value = myname; ... ... /script ~K Quoting Michael Jouravlev [EMAIL PROTECTED]: Are you saying that combination of nested properties and dynaform does not work for nested fields? Have you tried this: html:hidden name=myForm property=myBean.name/ html:hidden name=myForm property=myBean.password/ Michael. On 9/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All, I am trying to find a way to populate a DynaActionForm after the form has been submitted. For example, I have the following: public class MyBean implements serializable { public String name, address; public MyBean() { name = new String(); address = new String(); } public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getAddress() { return this.address; } public void setAddress(String address) { this.address = address; } } public class MyAction extends BaseDispatchAction { public ActionForward save(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { MyBean myBean = (MyBean)((DynaActionForm)form).get(MyBean); // do some processing ((DynaActionForm)form).set(myBean, myBean); return mapping.findForward(IConstants.SUCCESS_KEY); } } struts-config form-beans form-bean name=myForm dynamic=true type=org.apache.struts.action.DynaActionForm form-property name=myBean type=com.test.MyBean/ /form-bean /form-beans action-mappings action path=/MyAction type=com.test.MyAction parameter=method name=myForm scope=request forward name=Success path=my.page / /action /action-mappings /struts-config # JSP Page %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html head titleTest/title /head body html:form action=/MyAction method=post Hidden Test input type=submit name=submit value=submit/ html:hidden property= value=myname/ html:hidden property= value=myaddress/ /html:form /body /html I am not sure what to put in the property attribute in the html:hidden area so that it will populate MyBean in my DynaActionForm property. Please keep in mind that this is just a sample and I need to use the DynaActionForm and not extend the MyBean class to ActionForm. Any help or suggestion is much appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Javascript + Struts html:hidden write='true' tag problem
Thanks for your response. In the code in question, disabled is a local variable passed in as a parameter on the function, and does not refer to the form properties state. Although, this may lead to a hint of the 'reserved word' behavior I was trying to track. I suspected 'locked' was the culprit, but this gives me another avenue to test. Thanks! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, August 06, 2005 1:46 AM To: Struts Users Mailing List Subject: Re: Javascript + Struts html:hidden write='true' tag problem Duane, As far as I understand, disabled is a property of the form which should be denoted as document.forms[0].disabled and not just by disabled as you have done in if(disabled ==true ) change it to: if( document.forms[0].disabled == true ) and it should work. This is the reason the if(...) is always evaluating to false (i.e the 'else' case). Amitava Basak ASE Tata Consultancy Services Limited Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Duane Rosengartner [EMAIL PROTECTED] 08/06/2005 12:13 AM Please respond to Struts Users Mailing List user@struts.apache.org To struts-user@jakarta.apache.org cc Subject Javascript + Struts html:hidden write='true' tag problem I have the following Javascript primarily used to manipulate a CSS style and make a portion of a form visible. In the process, the achor invoking the JavaScript passes parameters from a table Row(resultset) displayed. In this Row, I have two bean properties declared as Java type Boolean. The toString() on the link resolves to 'true'/'false' correctly. I have placed alert tags in the javascript and have determined that the 'if' statements are working correctly also. The problem is that the two properties are behaving differently in the view, for reasons I cannot pin down. document.forms[0].disabled shows the correct status of the Row, document.forms[0].locked always shows false. I suspected 'locked' may be a reserved word, but have rewritten the bean and supporting code to rename the property, and this has had no effect. Things that DO WORK: The link is passing the correct values to JS, No JS error being thrown, as it would if the form property were not found. The visible, not visible works, also a checkbox instead shows the appropriate checked/not checked condition, so I can assume a page refresh is not the issue. Any other debug tips would be appreciated. Javascript: function PortalFilterForm_AccountDetails(rowId,rewardSummaryId,pin,inUse,disabled ) { //alert(rowId = + rowId + \nrewardSummaryId = + rewardSummaryId + \ninUse = + inUse + \ndisabled = + disabled); var detailElement = document.getElementById(accountDetail); detailElement.style.visibility = visible; var rid = document.getElementById(rid); rid.innerHTML = rowId; document.forms[0].rewardSummaryId.value = rewardSummaryId; document.forms[0].pin.value = pin; if(inUse == true){ document.forms[0].locked.checked = true; //alert(evaluated true); } else{ document.forms[0].locked.checked = false; //alert(evaluated false); } if(disabled == true) document.forms[0].disabled.checked = true; else document.forms[0].disabled.checked = false; //document.forms[0].locked.value = inUse; //document.forms[0].disabled.value = disabled; // also tried: //document.forms[0].locked.value = inUse + ; //document.forms[0].disabled.value = disabled + ; } JSP - Note the commented out code does not work (hidden write=true). The checkbox does work on both.. (Boolean type on both) ( Struts API says HTML:hidden requires String, but Boolean can be cast, and remember I have one working property, plus one not working ? ? ) td align=left width=15% %--html:hidden property=locked write=true/ --% html:checkbox property=locked disabled=true/ /td td align=right class=form-td-label width=15%span class=form-element-label Disabled /span/td td align=left %--html:hidden property=disabled write=true/--% html:checkbox property=disabled disabled=true/ /td * * a href=javascript:PortalFilterForm_AccountDetails(${row_rowNum},${row.rew ardSummaryId},${row.acctId},${row.inUse},${row.disabled}); class=fancy %=pageContext.getAttribute(row_rowNum)%/a ForwardSourceID:NT7576 Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Re: Javascript + Struts html:hidden write='true' tag problem
Duane, As far as I understand, disabled is a property of the form which should be denoted as document.forms[0].disabled and not just by disabled as you have done in if(disabled ==true ) change it to: if( document.forms[0].disabled == true ) and it should work. This is the reason the if(...) is always evaluating to false (i.e the 'else' case). Amitava Basak ASE Tata Consultancy Services Limited Mailto: [EMAIL PROTECTED] Website: http://www.tcs.com Duane Rosengartner [EMAIL PROTECTED] 08/06/2005 12:13 AM Please respond to Struts Users Mailing List user@struts.apache.org To struts-user@jakarta.apache.org cc Subject Javascript + Struts html:hidden write='true' tag problem I have the following Javascript primarily used to manipulate a CSS style and make a portion of a form visible. In the process, the achor invoking the JavaScript passes parameters from a table Row(resultset) displayed. In this Row, I have two bean properties declared as Java type Boolean. The toString() on the link resolves to 'true'/'false' correctly. I have placed alert tags in the javascript and have determined that the 'if' statements are working correctly also. The problem is that the two properties are behaving differently in the view, for reasons I cannot pin down. document.forms[0].disabled shows the correct status of the Row, document.forms[0].locked always shows false. I suspected 'locked' may be a reserved word, but have rewritten the bean and supporting code to rename the property, and this has had no effect. Things that DO WORK: The link is passing the correct values to JS, No JS error being thrown, as it would if the form property were not found. The visible, not visible works, also a checkbox instead shows the appropriate checked/not checked condition, so I can assume a page refresh is not the issue. Any other debug tips would be appreciated. Javascript: function PortalFilterForm_AccountDetails(rowId,rewardSummaryId,pin,inUse,disabled ) { //alert(rowId = + rowId + \nrewardSummaryId = + rewardSummaryId + \ninUse = + inUse + \ndisabled = + disabled); var detailElement = document.getElementById(accountDetail); detailElement.style.visibility = visible; var rid = document.getElementById(rid); rid.innerHTML = rowId; document.forms[0].rewardSummaryId.value = rewardSummaryId; document.forms[0].pin.value = pin; if(inUse == true){ document.forms[0].locked.checked = true; //alert(evaluated true); } else{ document.forms[0].locked.checked = false; //alert(evaluated false); } if(disabled == true) document.forms[0].disabled.checked = true; else document.forms[0].disabled.checked = false; //document.forms[0].locked.value = inUse; //document.forms[0].disabled.value = disabled; // also tried: //document.forms[0].locked.value = inUse + ; //document.forms[0].disabled.value = disabled + ; } JSP - Note the commented out code does not work (hidden write=true). The checkbox does work on both.. (Boolean type on both) ( Struts API says HTML:hidden requires String, but Boolean can be cast, and remember I have one working property, plus one not working ? ? ) td align=left width=15% %--html:hidden property=locked write=true/ --% html:checkbox property=locked disabled=true/ /td td align=right class=form-td-label width=15%span class=form-element-label Disabled /span/td td align=left %--html:hidden property=disabled write=true/--% html:checkbox property=disabled disabled=true/ /td * * a href=javascript:PortalFilterForm_AccountDetails(${row_rowNum},${row.rew ardSummaryId},${row.acctId},${row.inUse},${row.disabled}); class=fancy %=pageContext.getAttribute(row_rowNum)%/a ForwardSourceID:NT7576 Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Javascript + Struts html:hidden write='true' tag problem
I have the following Javascript primarily used to manipulate a CSS style and make a portion of a form visible. In the process, the achor invoking the JavaScript passes parameters from a table Row(resultset) displayed. In this Row, I have two bean properties declared as Java type Boolean. The toString() on the link resolves to 'true'/'false' correctly. I have placed alert tags in the javascript and have determined that the 'if' statements are working correctly also. The problem is that the two properties are behaving differently in the view, for reasons I cannot pin down. document.forms[0].disabled shows the correct status of the Row, document.forms[0].locked always shows false. I suspected 'locked' may be a reserved word, but have rewritten the bean and supporting code to rename the property, and this has had no effect. Things that DO WORK: The link is passing the correct values to JS, No JS error being thrown, as it would if the form property were not found. The visible, not visible works, also a checkbox instead shows the appropriate checked/not checked condition, so I can assume a page refresh is not the issue. Any other debug tips would be appreciated. Javascript: function PortalFilterForm_AccountDetails(rowId,rewardSummaryId,pin,inUse,disabled ) { //alert(rowId = + rowId + \nrewardSummaryId = + rewardSummaryId + \ninUse = + inUse + \ndisabled = + disabled); var detailElement = document.getElementById(accountDetail); detailElement.style.visibility = visible; var rid = document.getElementById(rid); rid.innerHTML = rowId; document.forms[0].rewardSummaryId.value = rewardSummaryId; document.forms[0].pin.value = pin; if(inUse == true){ document.forms[0].locked.checked = true; //alert(evaluated true); } else{ document.forms[0].locked.checked = false; //alert(evaluated false); } if(disabled == true) document.forms[0].disabled.checked = true; else document.forms[0].disabled.checked = false; //document.forms[0].locked.value = inUse; //document.forms[0].disabled.value = disabled; // also tried: //document.forms[0].locked.value = inUse + ; //document.forms[0].disabled.value = disabled + ; } JSP - Note the commented out code does not work (hidden write=true). The checkbox does work on both.. (Boolean type on both) ( Struts API says HTML:hidden requires String, but Boolean can be cast, and remember I have one working property, plus one not working ? ? ) td align=left width=15% %--html:hidden property=locked write=true/ --% html:checkbox property=locked disabled=true/ /td td align=right class=form-td-label width=15%span class=form-element-label Disabled /span/td td align=left %--html:hidden property=disabled write=true/--% html:checkbox property=disabled disabled=true/ /td * * a href=javascript:PortalFilterForm_AccountDetails(${row_rowNum},${row.rew ardSummaryId},${row.acctId},${row.inUse},${row.disabled}); class=fancy %=pageContext.getAttribute(row_rowNum)%/a
[HELP] How can javascript reference to 1 html:hidden tag or html:text ???
Hi, I don't know how javascript reference to 1 html:hidden tag or html:text tag of struts tag lib and change their value. for example: I have html:hidden property=userId How can I change the value of tag above by javascript. Maybe document.all.userId.value=somevalue -- like this ??? help me :(
RE: [HELP] How can javascript reference to 1 html:hidden tag or h tml:text ???
I don't know how javascript reference to 1 html:hidden tag or html:text tag of struts tag lib and change their value. for example: I have html:hidden property=userId document.getElementsByName(userId)[0].value=whatever; If you use the styleId attribute, which yields an id attribute in HTML: html:hidden property=userId styleId=somename/ You can do this: document.getElementById(somename).value=whatever; Note that the styleId attribute was mistakenly left out of the html:hidden tag in Struts 1.1. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [HELP] How can javascript reference to 1 html:hidden tag or html:text ???
document.forms['formBeanName'].elements['userId'].value = 'xyz'; if you invoke the Javascript from a form element, you can pass this reference and simply do: formReference.elements['userId'].value = 'xyz'; -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: 30 March 2005 16:50 To: 'Struts Users Mailing List' Subject: RE: [HELP] How can javascript reference to 1 html:hidden tag or html:text ??? I don't know how javascript reference to 1 html:hidden tag or html:text tag of struts tag lib and change their value. for example: I have html:hidden property=userId document.getElementsByName(userId)[0].value=whatever; If you use the styleId attribute, which yields an id attribute in HTML: html:hidden property=userId styleId=somename/ You can do this: document.getElementById(somename).value=whatever; Note that the styleId attribute was mistakenly left out of the html:hidden tag in Struts 1.1. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [HELP] How can javascript reference to 1 html:hidden tag or html:text ???
Thank you all :), my problem is solved! - Original Message - From: Mark Benussi [EMAIL PROTECTED] To: 'Struts Users Mailing List' user@struts.apache.org Sent: Thursday, March 31, 2005 12:05 AM Subject: RE: [HELP] How can javascript reference to 1 html:hidden tag or html:text ??? document.forms['formBeanName'].elements['userId'].value = 'xyz'; if you invoke the Javascript from a form element, you can pass this reference and simply do: formReference.elements['userId'].value = 'xyz'; -Original Message- From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED] Sent: 30 March 2005 16:50 To: 'Struts Users Mailing List' Subject: RE: [HELP] How can javascript reference to 1 html:hidden tag or html:text ??? I don't know how javascript reference to 1 html:hidden tag or html:text tag of struts tag lib and change their value. for example: I have html:hidden property=userId document.getElementsByName(userId)[0].value=whatever; If you use the styleId attribute, which yields an id attribute in HTML: html:hidden property=userId styleId=somename/ You can do this: document.getElementById(somename).value=whatever; Note that the styleId attribute was mistakenly left out of the html:hidden tag in Struts 1.1. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden query
html:hidden name=myBean property=myProperty/ Note that html:text property=myField/ is just enough to populate the text box. The bean:write/ in the body of html:text/ doesn't do anything. On Wed, 12 Jan 2005 23:34:27 -0800 (PST), Manisha Sathe [EMAIL PROTECTED] wrote: Following i could get it but now i want this inside html hidden form tag. html:text property=myField bean:write name=myBean property=myProperty / /html:text But If i use hidden tag then gives me error saying hidden can not have value. How can i put my bean data in html:hidden ? regards Manisha Janarthan Sathiamurthy [EMAIL PROTECTED] wrote: Hi, If you have a bean by name myBean in request scope, a property of the bean by name myProperty can be displayed in the jsp page by - Best Regards, Janarthan S Manisha Sathe wrote: I have Add/Edit/Delete for one database table. For Edit what i want is to get the values from database and display it on form as default. What i am doing is - 1)First calling one action handler getting the values from database and putting inside one data bean. Putting that bean inside request scope then forwarding to Edit Form 2)Inside Edit form I want to get these values as by default for text box I tried something many different combination using cout / html:bean... etc etc but i am not getting the values. Is there any good solution for getting default values inside Edit Form? regards Manisha - Do you Yahoo!? Meet the all-new My Yahoo! Try it today! - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - Do you Yahoo!? All your favorites on one personal page Try My Yahoo! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:hidden query
Following i could get it but now i want this inside html hidden form tag. html:text property=myField bean:write name=myBean property=myProperty / /html:text But If i use hidden tag then gives me error saying hidden can not have value. How can i put my bean data in html:hidden ? regards Manisha Janarthan Sathiamurthy [EMAIL PROTECTED] wrote: Hi, If you have a bean by name myBean in request scope, a property of the bean by name myProperty can be displayed in the jsp page by - Best Regards, Janarthan S Manisha Sathe wrote: I have Add/Edit/Delete for one database table. For Edit what i want is to get the values from database and display it on form as default. What i am doing is - 1)First calling one action handler getting the values from database and putting inside one data bean. Putting that bean inside request scope then forwarding to Edit Form 2)Inside Edit form I want to get these values as by default for text box I tried something many different combination using cout / html:bean... etc etc but i am not getting the values. Is there any good solution for getting default values inside Edit Form? regards Manisha - Do you Yahoo!? Meet the all-new My Yahoo! Try it today! - Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. - Do you Yahoo!? All your favorites on one personal page Try My Yahoo!
Re: html:hidden values are null
David, same here. a long weary day. :) the info you shared about onClick is new to me. I discussed this problem with a developer and he said that this values come null because there are more than one objects of the same kind. i.e, in an employee list there are more than one employees and since I have TD class=listbean:write name='empobj' property='name' //TD in my jsp, it is getting confused and doesnt know which value ( of which object) to carry across. Do you think this is the case? So how he has implemented is by tagging an index onto the selected object in the arraylist(which is being iterated) and comparing the original arraylist that he sent in the request(to be displayed in the page) to the one returned from the page. I understood the concept but am yet to understand how he implemented it. All this problems has befallen me because I am using the valueobject and it has a TimeValue attribute, which is very big. bean:write name='empobj' property='joinTime' / always gives me javascript errors saying ; is missing or something. the same with hidden values. Another idea that a friend gave me is to not use the value object directlty to write to the page. rather create another object where all the fields are String and pass that across the pages, so that it will just be form.getAttribute() in my action. I am confused. wading through code now. thanks for your input. On Mon, 18 Oct 2004 23:31:24 -0400, David G. Friedman [EMAIL PROTECTED] wrote: Rosemary, I had a long day at work so bear with me.. Are you using the JavaScript 'onClick' event to go to the new form which is resulting in missing hidden fields? If so, that is your problem: It isn't changing the action on the from (And then submitting the form) but changing the web page in the browser directly using window.location. That ignores all forms on the page and acts as if you typed the URL in the browser's location text box/window. I believe you would want to change the onClick to do something like this: onClick=javascript:this.form.action=\./empDetailPrepare.do\;this.form.sub mit(); My javascript might be slightly off but I'm definitely about there. This would result in the onClick event changing the form's submit location and then submitting the form. Any variables, hidden or visible, would be submitted to the new Struts action. Regards, David -Original Message- From: Rosemary Philip [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 9:13 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: html:hidden values are null Yes, the html:hidden is within an html:form. Also when I do a view source on the page, I can see the values of the hidden variables correctly. but when I trace them to action class, they are null, all of them. another thing. this is what my html:form tag in my first jsp page says. html:form action=/showempList method=post but in the same page I have this TR class=command onclick='window.location=./empDetailPrepare.do' , which goes to a different action. I dont know enough about Struts to know if this is a problem. There is a similar logic in another set of pages where , both are the same. I meant both actions are the same and that works. On Mon, 18 Oct 2004 00:01:51 -0400, David G. Friedman [EMAIL PROTECTED] wrote: Are you positive you have the html:hidden tag within the appropriate html:form tag? What is your html:form tag for either JSP? Regards, David -Original Message- From: Rosemary Philip [mailto:[EMAIL PROTECTED] Sent: Sunday, October 17, 2004 10:48 PM To: [EMAIL PROTECTED] Subject: html:hidden values are null I am having a problem getting values to another page when I try to use html:hidden. I have a list of employee objects in a page. on clicking on an employee from the list, the next page should show me more details on the employee. for getting the values across, i am trying to use html:hidden. but for some reason i am getting null for the attributes. when i do a view source on the page with the list, this is what i see. TR class=command onclick='window.location=./empDetailPrepare.do' input type=hidden name=empNmbr value=8423 input type=hidden name=empSSN value=55315 TD class=listHoward Austin/TD TD class=listProgrammer/TD The employee list shows the name and job title of the employee and I am passing empNmbr and empSSN as the hidden parameters. I have a EmplListForm (ActionForm) which has empNmbr and empSSN as the attributes. I have a Value Object Employee , which has a bunch of attributes like empNmbr,empSSN,name,jobTitle etc. --- struts-config.xml !--*** emp list form bean, just used to pass some properties to the next page***-- form-bean name=empListbean type=com.test.web.forms.empListForm /form-bean
RE: html:hidden values are null
Rosemary, I had a long day at work so bear with me.. Are you using the JavaScript 'onClick' event to go to the new form which is resulting in missing hidden fields? If so, that is your problem: It isn't changing the action on the from (And then submitting the form) but changing the web page in the browser directly using window.location. That ignores all forms on the page and acts as if you typed the URL in the browser's location text box/window. I believe you would want to change the onClick to do something like this: onClick=javascript:this.form.action=\./empDetailPrepare.do\;this.form.sub mit(); My javascript might be slightly off but I'm definitely about there. This would result in the onClick event changing the form's submit location and then submitting the form. Any variables, hidden or visible, would be submitted to the new Struts action. Regards, David -Original Message- From: Rosemary Philip [mailto:[EMAIL PROTECTED] Sent: Monday, October 18, 2004 9:13 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: html:hidden values are null Yes, the html:hidden is within an html:form. Also when I do a view source on the page, I can see the values of the hidden variables correctly. but when I trace them to action class, they are null, all of them. another thing. this is what my html:form tag in my first jsp page says. html:form action=/showempList method=post but in the same page I have this TR class=command onclick='window.location=./empDetailPrepare.do' , which goes to a different action. I dont know enough about Struts to know if this is a problem. There is a similar logic in another set of pages where , both are the same. I meant both actions are the same and that works. On Mon, 18 Oct 2004 00:01:51 -0400, David G. Friedman [EMAIL PROTECTED] wrote: Are you positive you have the html:hidden tag within the appropriate html:form tag? What is your html:form tag for either JSP? Regards, David -Original Message- From: Rosemary Philip [mailto:[EMAIL PROTECTED] Sent: Sunday, October 17, 2004 10:48 PM To: [EMAIL PROTECTED] Subject: html:hidden values are null I am having a problem getting values to another page when I try to use html:hidden. I have a list of employee objects in a page. on clicking on an employee from the list, the next page should show me more details on the employee. for getting the values across, i am trying to use html:hidden. but for some reason i am getting null for the attributes. when i do a view source on the page with the list, this is what i see. TR class=command onclick='window.location=./empDetailPrepare.do' input type=hidden name=empNmbr value=8423 input type=hidden name=empSSN value=55315 TD class=listHoward Austin/TD TD class=listProgrammer/TD The employee list shows the name and job title of the employee and I am passing empNmbr and empSSN as the hidden parameters. I have a EmplListForm (ActionForm) which has empNmbr and empSSN as the attributes. I have a Value Object Employee , which has a bunch of attributes like empNmbr,empSSN,name,jobTitle etc. --- struts-config.xml !--*** emp list form bean, just used to pass some properties to the next page***-- form-bean name=empListbean type=com.test.web.forms.empListForm /form-bean !--*** show the emp list ***-- action path=/showempList type=com.test.web.actions.EmpListAction name=empListbean scope=request forward name=empdetailprepare path=/empDetailPrepare.do/ /action !--*** prepares the event detail screen for display ***-- action path=/empDetailPrepare type=com.test.web.actions.EmpDetailsPrepareAction name=empListbean scope=request forward name=continue path=/empDetail.jsp/ /action -- empList.jsp html:hidden name='empobj' property='empNmbr'/ html:hidden name='empobj' property='evntTm'/ TD class=listbean:write name='empobj' property='name' //TD TD class=listbean:write name='empobj' property='jobTitle' //TD -- in my action class EmplListForm emplListForm = (EmplListForm ) form; System.out.println(empNmbr = +request.getAttribute(empNmbr)); I am at a loss at to what am I missing here. Can anyone point out anything? Thanks, Rosemary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:hidden values are null
I am having a problem getting values to another page when I try to use html:hidden. I have a list of employee objects in a page. on clicking on an employee from the list, the next page should show me more details on the employee. for getting the values across, i am trying to use html:hidden. but for some reason i am getting null for the attributes. when i do a view source on the page with the list, this is what i see. TR class=command onclick='window.location=./empDetailPrepare.do' input type=hidden name=empNmbr value=8423 input type=hidden name=empSSN value=55315 TD class=listHoward Austin/TD TD class=listProgrammer/TD The employee list shows the name and job title of the employee and I am passing empNmbr and empSSN as the hidden parameters. I have a EmplListForm (ActionForm) which has empNmbr and empSSN as the attributes. I have a Value Object Employee , which has a bunch of attributes like empNmbr,empSSN,name,jobTitle etc. --- struts-config.xml !--*** emp list form bean, just used to pass some properties to the next page***-- form-bean name=empListbean type=com.test.web.forms.empListForm /form-bean !--*** show the emp list ***-- action path=/showempList type=com.test.web.actions.EmpListAction name=empListbean scope=request forward name=empdetailprepare path=/empDetailPrepare.do/ /action !--*** prepares the event detail screen for display ***-- action path=/empDetailPrepare type=com.test.web.actions.EmpDetailsPrepareAction name=empListbean scope=request forward name=continue path=/empDetail.jsp/ /action -- empList.jsp html:hidden name='empobj' property='empNmbr'/ html:hidden name='empobj' property='evntTm'/ TD class=listbean:write name='empobj' property='name' //TD TD class=listbean:write name='empobj' property='jobTitle' //TD -- in my action class EmplListForm emplListForm = (EmplListForm ) form; System.out.println(empNmbr = +request.getAttribute(empNmbr)); I am at a loss at to what am I missing here. Can anyone point out anything? Thanks, Rosemary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:hidden values are null
Are you positive you have the html:hidden tag within the appropriate html:form tag? What is your html:form tag for either JSP? Regards, David -Original Message- From: Rosemary Philip [mailto:[EMAIL PROTECTED] Sent: Sunday, October 17, 2004 10:48 PM To: [EMAIL PROTECTED] Subject: html:hidden values are null I am having a problem getting values to another page when I try to use html:hidden. I have a list of employee objects in a page. on clicking on an employee from the list, the next page should show me more details on the employee. for getting the values across, i am trying to use html:hidden. but for some reason i am getting null for the attributes. when i do a view source on the page with the list, this is what i see. TR class=command onclick='window.location=./empDetailPrepare.do' input type=hidden name=empNmbr value=8423 input type=hidden name=empSSN value=55315 TD class=listHoward Austin/TD TD class=listProgrammer/TD The employee list shows the name and job title of the employee and I am passing empNmbr and empSSN as the hidden parameters. I have a EmplListForm (ActionForm) which has empNmbr and empSSN as the attributes. I have a Value Object Employee , which has a bunch of attributes like empNmbr,empSSN,name,jobTitle etc. --- struts-config.xml !--*** emp list form bean, just used to pass some properties to the next page***-- form-bean name=empListbean type=com.test.web.forms.empListForm /form-bean !--*** show the emp list ***-- action path=/showempList type=com.test.web.actions.EmpListAction name=empListbean scope=request forward name=empdetailprepare path=/empDetailPrepare.do/ /action !--*** prepares the event detail screen for display ***-- action path=/empDetailPrepare type=com.test.web.actions.EmpDetailsPrepareAction name=empListbean scope=request forward name=continue path=/empDetail.jsp/ /action -- empList.jsp html:hidden name='empobj' property='empNmbr'/ html:hidden name='empobj' property='evntTm'/ TD class=listbean:write name='empobj' property='name' //TD TD class=listbean:write name='empobj' property='jobTitle' //TD -- in my action class EmplListForm emplListForm = (EmplListForm ) form; System.out.println(empNmbr = +request.getAttribute(empNmbr)); I am at a loss at to what am I missing here. Can anyone point out anything? Thanks, Rosemary - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden tag
Yes it is. On Tue, 5 Oct 2004 10:47:17 +1000, Yakov Belov [EMAIL PROTECTED] wrote: I presume it is the struts tag for the standard html : input type=hidden ... - Original Message - From: Phani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 10:36 AM Subject: html:hidden tag Anyone has any idea about this tag: html:hidden name=customForm property=mode/ Please let me know. Thanks. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:hidden tag
Anyone has any idea about this tag: html:hidden name=customForm property=mode/ Please let me know. Thanks. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden tag
The User Guide is always a good place to start... http://struts.apache.org/userGuide/struts-html.html#hidden Niall - Original Message - From: Phani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 1:36 AM Subject: html:hidden tag Anyone has any idea about this tag: html:hidden name=customForm property=mode/ Please let me know. Thanks. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:hidden tag
I presume it is the struts tag for the standard html : input type=hidden ... - Original Message - From: Phani [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, October 05, 2004 10:36 AM Subject: html:hidden tag Anyone has any idea about this tag: html:hidden name=customForm property=mode/ Please let me know. Thanks. __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
why nested:hidden field not supports styleId property but html:hidden supports....
Hi friends Thanq 4ur non-stoping help. i need styleId property in nested:hidden field as it is in html:hidden field. But it doesn't support that . Where as html:hidden supports it. what can i do for that? Is there any equallent property for styleId in nested:hidden Pls let me know u solution . awaiting for ur reply. Thanks Ganesh - Do you Yahoo!? Yahoo! Mail - You care about security. So do we.
why nested:hidden field not supports styleId property but html:hidden supports....
Hi friends Thanq 4ur non-stoping help. i need styleId property in nested:hidden field as it is in html:hidden field. But it doesn't support that . Where as html:hidden supports it. what can i do for that? Is there any equallent property for styleId in nested:hidden Pls let me know u solution . awaiting for ur reply. Thanks Ganesh __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: why nested:hidden field not supports styleId property but html:hidden supports....
Generally struts tags only allow attributes which are part of the HTML 4.01 Specification - I'm not sure whether id is or isn't for input type=hidden, but I guess the logic goes that why would you need it for something which isn't visible. Anyway, you could modify the struts-html.tld to add this attribute and and it should then render it. Niall - Original Message - From: ganesh gadi [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, July 08, 2004 11:43 AM Subject: why nested:hidden field not supports styleId property but html:hidden supports Hi friends Thanq 4ur non-stoping help. i need styleId property in nested:hidden field as it is in html:hidden field. But it doesn't support that . Where as html:hidden supports it. what can i do for that? Is there any equallent property for styleId in nested:hidden Pls let me know u solution . awaiting for ur reply. Thanks Ganesh __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How can i put a dynamic value to an html:hidden ?
I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John
RE: How can i put a dynamic value to an html:hidden ?
Hi John, this kind of nesting is not possible in Struts. It has been discussed many times in many forums already. The solution is to define a scripting variable and assign it then: bean:define id=someId name=member property=firstname/ html:hidden property=firstname value=%= someId%/ Radek -Original Message- From: John Antonakos [mailto:[EMAIL PROTECTED] Sent: Friday, June 25, 2004 12:17 PM To: [EMAIL PROTECTED] Subject: How can i put a dynamic value to an html:hidden ? I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John
Re: How can i put a dynamic value to an html:hidden ?
just out of curiosity, what is html-el ? i use JSTL, but even in that, i cannot do this: html:hidden property=firstname value=c:out value=${member.firstname}// John - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 25, 2004 1:26 PM Subject: SV: How can i put a dynamic value to an html:hidden ? Hi use html-el and then : html:hidden property=firstname value=${member.firstname}/ -Opprinnelig melding- Fra: John Antonakos [mailto:[EMAIL PROTECTED] Sendt: 25. juni 2004 12:17 Til: [EMAIL PROTECTED] Emne: How can i put a dynamic value to an html:hidden ? I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can i put a dynamic value to an html:hidden ?
As other posters have said, you can't use a jsp tag to provide the value of an attribute in another tag. Ever. However, what you are doing is (probably) redundant. The purpose of the html:hidden tag is to *automatically* create an input type=hidden/ element in your form with the value already set according to the value in your form bean. If you just want to create a hidden input with a value from something other than your form bean just use the html tag directly. As this is not a jsp tag you can use a jsp tag as an attribute: input type=hidden name=firstname value=bean:write name=member property=firstname// Paul -Original Message- From: John Antonakos [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 11:17 To: [EMAIL PROTECTED] Subject: How can i put a dynamic value to an html:hidden ? I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How can i put a dynamic value to an html:hidden ?
Dear Paul, i know all that, thanks for the remarks though. I was using that anyway. I just decided to change them all to html: tags and realized that i cannot. do it in this specific case. Only for those tags i will keep the old ones. Thanks, anyway John - Original Message - From: Paul McCulloch [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, June 25, 2004 1:37 PM Subject: RE: How can i put a dynamic value to an html:hidden ? As other posters have said, you can't use a jsp tag to provide the value of an attribute in another tag. Ever. However, what you are doing is (probably) redundant. The purpose of the html:hidden tag is to *automatically* create an input type=hidden/ element in your form with the value already set according to the value in your form bean. If you just want to create a hidden input with a value from something other than your form bean just use the html tag directly. As this is not a jsp tag you can use a jsp tag as an attribute: input type=hidden name=firstname value=bean:write name=member property=firstname// Paul -Original Message- From: John Antonakos [mailto:[EMAIL PROTECTED] Sent: 25 June 2004 11:17 To: [EMAIL PROTECTED] Subject: How can i put a dynamic value to an html:hidden ? I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: How can i put a dynamic value to an html:hidden ?
Hi import the struts-el tag library and the tld for it - Then you can ust jstl syntax. Right now you are using the standard struts tag library Hermod -Opprinnelig melding- Fra: John Antonakos [mailto:[EMAIL PROTECTED] Sendt: 25. juni 2004 12:30 Til: Struts Users Mailing List Emne: Re: How can i put a dynamic value to an html:hidden ? just out of curiosity, what is html-el ? i use JSTL, but even in that, i cannot do this: html:hidden property=firstname value=c:out value=${member.firstname}// John - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 25, 2004 1:26 PM Subject: SV: How can i put a dynamic value to an html:hidden ? Hi use html-el and then : html:hidden property=firstname value=${member.firstname}/ -Opprinnelig melding- Fra: John Antonakos [mailto:[EMAIL PROTECTED] Sendt: 25. juni 2004 12:17 Til: [EMAIL PROTECTED] Emne: How can i put a dynamic value to an html:hidden ? I want to do something like the following: html:hidden property=firstname value=bean name=member property=firstname// is this possible ? The above statement produces an error. Can i use another statement to do this thing ? Give a dynamic value, coming from another bean, to an html:hidden field ? Regards, John * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that DnB NOR cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting html:hidden property using JSTL
I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting html:hidden property using JSTL
Small clarification that the Servlet 2.4/JSP 2.0 specs don't include/require JSTL. Although a given container may include a JSTL implementation (like Resin, I believe), it's not a requirement. For example, Tomcat 5.0 does not include a JSTL implementation. For JSP 1.2, use JSTL 1.0. For JSP 2.0, use JSTL 1.1. As Robert illustrated, the taglib URIs are not the same for the two JSTL versions. Quoting Robert Taylor [EMAIL PROTECTED]: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting html:hidden property using JSTL
Right. Thanks for the clarification, Kris. robert -Original Message- From: Kris Schneider [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:39 AM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL Small clarification that the Servlet 2.4/JSP 2.0 specs don't include/require JSTL. Although a given container may include a JSTL implementation (like Resin, I believe), it's not a requirement. For example, Tomcat 5.0 does not include a JSTL implementation. For JSP 1.2, use JSTL 1.0. For JSP 2.0, use JSTL 1.1. As Robert illustrated, the taglib URIs are not the same for the two JSTL versions. Quoting Robert Taylor [EMAIL PROTECTED]: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED
RE: Setting html:hidden property using JSTL
Robert, I am using servlet spec 2.3 and i did all the steps you mentioned. Thanks, James --- Robert Taylor [EMAIL PROTECTED] wrote: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
RE: Setting html:hidden property using JSTL
David, I am using Tomcat 4.1.29 so those concerns are not applicable here Thanks, James --- Karr, David [EMAIL PROTECTED] wrote: What container are you using? If this is Resin, this has been known to cause problems because of the fact that Resin has an integrated version of the JSTL which doesn't work the same as the Jakarta one. If you're using Resin, make sure the integrated JSTL is not being used. -Original Message- From: klute [mailto:[EMAIL PROTECTED] Robert, I am using servlet spec 2.3 and i did all the steps you mentioned. Thanks, James --- Robert Taylor [EMAIL PROTECTED] wrote: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be === message truncated === __ Do you Yahoo!? Read only the mail you want - Yahoo! Mail SpamGuard. http://promotions.yahoo.com/new_mail
RE: Setting html:hidden property using JSTL
Assuming you are using the Struts-EL tag library: Try: html_el:hidden property=itemIdx value=${itemIdx.count}/ robert -Original Message- From: Tom McCobb [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:05 PM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL I am having the same nagging problem in JBoss3.2.3/Tomcat4.1. c:forEach var=costs value=${DetailForm.detail.costs} varStatus=itemIdx c:out value=${itemIdx.count} / ---this works just fine html:hidden property=itemIdx value=${c:out value='${itemIdx.count}'// The last line always renders as 'c:out value=${itemIdx.count}/' both in the Form property and the request parameter. I checked versions, etc. as detailed earlier in this thread. I'm stumped. Tom McC. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL What container are you using? If this is Resin, this has been known to cause problems because of the fact that Resin has an integrated version of the JSTL which doesn't work the same as the Jakarta one. If you're using Resin, make sure the integrated JSTL is not being used. -Original Message- From: klute [mailto:[EMAIL PROTECTED] Robert, I am using servlet spec 2.3 and i did all the steps you mentioned. Thanks, James --- Robert Taylor [EMAIL PROTECTED] wrote: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId
RE: Setting html:hidden property using JSTL
Setup checklist - here's what should be in WEB-INF/lib: Struts 1.1: --- commons-beanutils.jar commons-collections.jar commons-digester.jar commons-fileupload.jar commons-lang.jar commons-logging.jar commons-validator.jar jakarta-oro.jar struts-el.jar struts.jar Standard 1.0.5: --- jaxen-full.jar jstl.jar saxpath.jar standard.jar jaxen-full.jar and saxpath.jar are only required if you want to use JSTL's XML/XSLT tags. Remove the TLD files from your app, remove the taglib elements from web.xml, and use the well-known URIs for the taglibs: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % %@ taglib prefix=html uri=http://jakarta.apache.org/struts/tags-html; % %@ taglib prefix=html-el uri=http://jakarta.apache.org/struts/tags-html-el; % Quoting klute [EMAIL PROTECTED]: Tom, I have the same setup: JBoss3.2.3/Tomcat4.1.29 James --- Tom McCobb [EMAIL PROTECTED] wrote: I am having the same nagging problem in JBoss3.2.3/Tomcat4.1. c:forEach var=costs value=${DetailForm.detail.costs} varStatus=itemIdx c:out value=${itemIdx.count} / ---this works just fine html:hidden property=itemIdx value=${c:out value='${itemIdx.count}'// The last line always renders as 'c:out value=${itemIdx.count}/' both in the Form property and the request parameter. I checked versions, etc. as detailed earlier in this thread. I'm stumped. Tom McC. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL What container are you using? If this is Resin, this has been known to cause problems because of the fact that Resin has an integrated version of the JSTL which doesn't work the same as the Jakarta one. If you're using Resin, make sure the integrated JSTL is not being used. -Original Message- From: klute [mailto:[EMAIL PROTECTED] Robert, I am using servlet spec 2.3 and i did all the steps you mentioned. Thanks, James --- Robert Taylor [EMAIL PROTECTED] wrote: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote
Re: Setting html:hidden property using JSTL
Tom McCobb wrote: I am having the same nagging problem in JBoss3.2.3/Tomcat4.1. c:forEach var=costs value=${DetailForm.detail.costs} varStatus=itemIdx c:out value=${itemIdx.count} / ---this works just fine html:hidden property=itemIdx value=${c:out value='${itemIdx.count}'// The last line always renders as 'c:out value=${itemIdx.count}/' both in the Form property and the request parameter. I checked versions, etc. as detailed earlier in this thread. I'm stumped. I'm using JBoss3.2 and Tomcat4.1 and do not have these problems so there is a way to fix this:) First off, have you tried the html-el tag and then used: html-el:hidden property=itemIdx value=${itemIdx.count}'/ (Of course the above could be html:hidden assuming you are defining the html tag definition to use the html-el tld ) That DEFINITELY should work. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting html:hidden property using JSTL
Got it to work: turns out I had jstl1.1 deployed in the 2.3 container and it wasn't apparently screwed up until I tried to do this. -Original Message- From: Robert Taylor [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:17 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: Setting html:hidden property using JSTL Assuming you are using the Struts-EL tag library: Try: html_el:hidden property=itemIdx value=${itemIdx.count}/ robert -Original Message- From: Tom McCobb [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 12:05 PM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL I am having the same nagging problem in JBoss3.2.3/Tomcat4.1. c:forEach var=costs value=${DetailForm.detail.costs} varStatus=itemIdx c:out value=${itemIdx.count} / ---this works just fine html:hidden property=itemIdx value=${c:out value='${itemIdx.count}'// The last line always renders as 'c:out value=${itemIdx.count}/' both in the Form property and the request parameter. I checked versions, etc. as detailed earlier in this thread. I'm stumped. Tom McC. -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 11:00 AM To: Struts Users Mailing List Subject: RE: Setting html:hidden property using JSTL What container are you using? If this is Resin, this has been known to cause problems because of the fact that Resin has an integrated version of the JSTL which doesn't work the same as the Jakarta one. If you're using Resin, make sure the integrated JSTL is not being used. -Original Message- From: klute [mailto:[EMAIL PROTECTED] Robert, I am using servlet spec 2.3 and i did all the steps you mentioned. Thanks, James --- Robert Taylor [EMAIL PROTECTED] wrote: I'm sorry, I've missed parts of this thread, but this last message caught my eye when you said it's printing ${contentId} to the screen instead of the value of contentId. Which servlet spec. does your container support? I've seen this type of behavior when the container supports Servlet Spec. 2.4 but the web.xml file is referring to the 2.3 dtd. If your container does support the 2.4 spec, then make sure your web.xml file has web-app version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; in its root element. Again, if your container does support the 2.4 spec, then you shouldn't need any .tld files or even jar files for JSTL. All you should have to do is add (or include) something like this to the top of your .jsp page. %-- JSTL Standard Tags --% %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % If your container does not support the 2.4 spec, then you will need to include the appropriate .tld and .jar files and update your web.xml file to reference the appropriate .tld file(s). robert -Original Message- From: klute [mailto:[EMAIL PROTECTED] Sent: Thursday, June 24, 2004 10:01 AM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL Hello All, I *really* appreciate your help. Because of a hard-pressing work deadline, i actually gave up on getting that to work using JSTL and ended up using the ugly input type=hidden name=contentId value=%=request.getAttribute(contentId)%/ instead. I'll definitely come back to JSTL at a later time since i consider that to be a proper way of doing this sort of things. Robert, if ${contentId} is available as an attribute (which it was) and not as a parameter, i would expect it to produce null or something instead of literally printing out ${contentId} string... Rick, i tried creating a var in the jsp and the result would still be the same: the value of the hidden property was printed out as {$myVar}. And, if i do c:out in the begging of the jsp, i do get an actual int value printed. weird... i definitely need to spend more time doing my homework to understand how it works... All the best, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el
Re: Setting html:hidden property using JSTL
It's not possible to use a custom tag as the value of another custom tag attribute. You should use JSP 2.0 or struts-el instead. Regards, Michael Nascimento Santos JSR-207 Expert Group Member http://www.javablogs.com.br/blogs/page/soujavamisterm http://today.java.net/pub/au/80 Sun Certified Programmer for the Java 2 Platform 1.2 1.4 Sun Certified Web Component Developer for J2EE Sun Certified Mobile Application Developer - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 2:31 PM Subject: Re: Setting html:hidden property using JSTL James Do you include the HTML tag library within the jsp page? It needs to go at the top and look like this: %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Cheers Christopher Marsh-Bourdon Pyplia Limited klute [EMAIL PROTECTED] 23/06/2004 18:25 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Setting html:hidden property using JSTL Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? I did check that c:out value=${contentId}/ returns a valid value so my confusion is just passing it as a value to the html:hidden property. Any help is greatly appreciated. James __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting html:hidden property using JSTL
Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? I did check that c:out value=${contentId}/ returns a valid value so my confusion is just passing it as a value to the html:hidden property. Any help is greatly appreciated. James __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
I've also noticed you are doubling up on double quotes, try this: html:hidden property=contentId value=c:out value='${contentId}'// or html:hidden property=contentId value='c:out value=${contentId}/'/ Cheers Christopher Marsh-Bourdon Pyplia Limited klute [EMAIL PROTECTED] 23/06/2004 18:25 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Setting html:hidden property using JSTL Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? I did check that c:out value=${contentId}/ returns a valid value so my confusion is just passing it as a value to the html:hidden property. Any help is greatly appreciated. James __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited.
Re: Setting html:hidden property using JSTL
James Do you include the HTML tag library within the jsp page? It needs to go at the top and look like this: %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % Cheers Christopher Marsh-Bourdon Pyplia Limited klute [EMAIL PROTECTED] 23/06/2004 18:25 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Setting html:hidden property using JSTL Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? I did check that c:out value=${contentId}/ returns a valid value so my confusion is just passing it as a value to the html:hidden property. Any help is greatly appreciated. James __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - The information in this e-mail is confidential. It is intended solely for the addressee. If you are not the intended recipient please notify the sender immediately and delete this message. Any review, dissemination, distribution, copying or other use of this communication or the information in it is strictly prohibited.
R: Setting html:hidden property using JSTL
Hi, yes you can use the EL but depends on the Web Container you are using. If you have a Web container JSP2.0 (and 2.4 servlet) compliant (for example Tomcat5.0.x), you can use JSTL 1.1 (if you want to use them you have to set your application)and html Struts standard. In order to use, this version you have to do the following in the jsp page: %@ taglib uri=http://jakarta.apache.org/struts/tags-html; prefix=html% html:hidden property=contentId value=${contentId}/ But if you have a WebContainer JSP1.2 compliant (e.g. Tomcat 4.x) you have to use the html-el version + JSTL1.0. They are in the contrib directory inside the struts directory. But in this case the procedure in order to use them is just to complicate. BR /Amleto -Messaggio originale- Da: klute [mailto:[EMAIL PROTECTED] Inviato: mercoledì 23 giugno 2004 19.25 A: Struts Users Mailing List Oggetto: Setting html:hidden property using JSTL Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? I did check that c:out value=${contentId}/ returns a valid value so my confusion is just passing it as a value to the html:hidden property. Any help is greatly appreciated. James __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
klute wrote: Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? Use the html-el tag instead of the html tag. Then you can do: html-el:hidden property=contentId value=${contentId}/ Much cleaner. Although remember it might even be easier/cleaner to simply make sure contentId is in your ActionForm .. then you can just do... html:hidden property=contentId/ and it'll set the value for you. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
Thanks a lot to all who responded! So i tried using html-el using the syntax Rick suggested: html-el:hidden property=contentId value=${contentId}/ The resulting html contains: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Thanks a lot, James --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: Hi All, I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. Basically, i'd like to do something like this: html:hidden property=contentId value=c:out value=${contentId}// Which does not work. Should i be using EL syntax instead? And what would the correct syntax be? Use the html-el tag instead of the html tag. Then you can do: html-el:hidden property=contentId value=${contentId}/ Much cleaner. Although remember it might even be easier/cleaner to simply make sure contentId is in your ActionForm .. then you can just do... html:hidden property=contentId/ and it'll set the value for you. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Are you sure you added the struts-el jar to your webapp lib? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Are you sure you added the struts-el jar to your webapp lib? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - 50x more storage than other providers! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Setting html:hidden property using JSTL
klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting html:hidden property using JSTL
I believe the reason it's not populated in the action form is because its in the request as an attribute and not a parameter. snip-from-original-post I just started experimenting with jstl and i'd like to set a hidden field on MyActionForm using a value (contentId) available as an attribute on the request. /snip-from-original-post robert -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 23, 2004 3:23 PM To: Struts Users Mailing List Subject: Re: Setting html:hidden property using JSTL klute wrote: Yes, the struts-el.jar is in WEB-INF/lib --- Rick Reumann [EMAIL PROTECTED] wrote: klute wrote: input type=hidden name=contentId value=${contentId} This are the tagligs i am importing on this page: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-html-el.tld prefix=html-el % %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % What am i doing wrong? Not sure. If you have - struts-el jar included - proper definition of the tld in web.xml - proper declaration for the tld on top of the page then using it as: html-el:hidden property=contentId value=${contentId}/ should be fine. The only thing I'm still concerned about and maybe somehow it's related is that contentId has to be a property of your ActionForm or else Struts would complain that it couldn't find the property 'contentId' Are you maybe creating the contentId var dynamically first in the JSP page and then trying to set as above? Usually you don't need to do like you are doing (setting the value) since that value can be set before you get to the page and thus just doing html:hidden property=contentId would be fine. What does c:out value=${contentId}/ produce on the page (or in source) when placed right before the html-el hidden tag? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]