[Resolved] [S2] Setting current value of an iterator inside onClick of a s:a tag
Hi everybody, One of my programmer asked me the following: I try to set the current value of a s:iterator in the onclick of a s:a tag, but it doesn't work. How can I do this? I know that I can't use something like overlapping tags: s:iterator value=nbPages s:a href=# onclick=javascript:refresh(s:property /);return false;s:property //s:a /s:iterator Here, I put s:property / inside onclick attribute, the output is: # 1 (not very surprising...) Since I resolved his problem while starting to write this question in the Struts forum, I'll nevertheless send the solution, in the case other new users of Struts 2 have the question. The solution is to use use OGNL (or EL, expression language, if your JEE version is 4 or 5): s:iterator value=nbPages s:a href=# onclick=javascript:refresh(%{top});return false;s:property //s:a /s:iterator top represent the current element of the iterator. It is a keyword in OGNL/Struts 2 (correct me if I'm wrong). Cheers, Cyril Gambis -- View this message in context: http://www.nabble.com/-Resolved---S2--Setting-current-value-of-an-iterator-inside-%22onClick%22-of-a-%22s%3Aa%22-tag-tf4427467.html#a12630101 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
writing dynamic content using JspWriter out
In my jsp I use JspWriter to write my page content .I can write lot of static data but I cannot write dynamic content like scriptlet or tag library ie even if I write tag library or scriptlet it will not be executed .Is there any solution for this ? Miro - Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
[OT] Re: writing dynamic content using JspWriter out
2007/9/12, temp temp [EMAIL PROTECTED]: In my jsp I use JspWriter to write my page content .I can write lot of static data but I cannot write dynamic content like scriptlet or tag library ie even if I write tag library or scriptlet it will not be executed .Is there any solution for this ? No! When you use JspWriter, you send your data directly to the client! Therefore, it does not pass to the JSP compiler. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: writing dynamic content using JspWriter out
in this case is there is no way to invoke jsp compiler or is there any workaround for this problem ? Miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : In my jsp I use JspWriter to write my page content .I can write lot of static data but I cannot write dynamic content like scriptlet or tag library ie even if I write tag library or scriptlet it will not be executed .Is there any solution for this ? No! When you use JspWriter, you send your data directly to the client! Therefore, it does not pass to the JSP compiler. Antonio - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Be a better Globetrotter. Get better travel answers from someone who knows. Yahoo! Answers - Check it out.
Re: [OT] Re: writing dynamic content using JspWriter out
2007/9/12, temp temp [EMAIL PROTECTED]: in this case is there is no way to invoke jsp compiler or is there any workaround for this problem ? Do you want to invoke a JSP compiler inside a webapp? If it is possible, surely it is not portable. I suggest you to write pure HTML. Antonio
Re: [S2] Issues with AJAX in IE
Well I checked out the samples in the struts 2 showcase and I get the same problem. It seems that when I submit a form using the enter key instead of clicking the button my results displayed in a new page still. Again this only occurs in IE 6, 7 (haven't tested with lower versions). I figured I could add a javascript where I check if the user hits the enter key and then just submit the form, but then I'll have to do that for every ajax form. Has anyone encountered this issue before or is there something wrong with my code. It works fine though in firefox. Grish wrote: I'm not so sure if this is some bug, but I noticed an odd behaviour with my AJAX forms in IE. For Firefox, if I hit the submit button for my form, my output is displayed in my DIV area as exepcted. Same for IE. But in IE, when I hit enter button instead of clicking on my submit button the whole jsp for that ajax call is displayed instead of returning the output in the DIV area. With Firefox there is no issue. I've noticed this in IE 6 and 7. I'm actually modifying the Struts 2 + Spring 2 + JPA + AJAX tutorial. Here's my code: s:form action=searchAjax namespace=/persons validate=true s:textfield id=search label=%{getText('search.label')} name=searchCriteria / s:submit key=search.button theme=ajax targets=persons / /s:form s:url action=listAjax namespace=/persons id=descrsUrl/ div style=width: 300px;border-style: solid s:div id=persons theme=ajax href=%{descrsUrl} loadingText=Loading... / /div I don't know if this is some bug or there's something wrong with my setup. Has anyone encountered a similar problem? -- View this message in context: http://www.nabble.com/-S2--Issues-with-AJAX-in-IE-tf4210453.html#a12631120 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: writing dynamic content using JspWriter out
My applications writes html out of an xml file.this xml has feilds with there presentation type.This field element in xml can have cdata section which allows user to write any thing like scripts or bean tags or any other custom tag library ,html. for example field name=my-field presentation-type=text layout resource align=right ![CDATA[ span class=smallBlueText/ bean:write name=my-object/ ]] resource /layout /field I parse this information and use JspWiter to write.The probelm is, in cdata scetion the first part span class=smallBlueText/ works but the second line bean:write name=my-object/ does not work ie bean:write does not print value of my-object Is there any way I can reslve this Miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : in this case is there is no way to invoke jsp compiler or is there any workaround for this problem ? Do you want to invoke a JSP compiler inside a webapp? If it is possible, surely it is not portable. I suggest you to write pure HTML. Antonio - Fussy? Opinionated? Impossible to please? Perfect. Join Yahoo!'s user panel and lay it on us.
[s2] Is it possible to have seperate validtion files for each method without using wildcards.
Is it possible to have seperate validtion files for each method. Bascially it would be very nice to be able to have s:submit action=Test method=test1 key=test1/ s:submit action=Test method=test2 key=test2/ and be able to have seperate validations for both methods instead of using the alias. s:submit action=Test_test1 key=test1/ s:submit action=Test_test2 key=test2/ This approach seems to be a more elegant way of validating as at the moment you have to use a wildcard hack to accomplish it. __ Ufi Limited Registered in England No. 3980770 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP learndirect Solutions Ltd Registered in England No. 5081669 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP UFI Charitable Trust Registered in England No. 3658378 Registered Charity No. 1081028 Registered Office: Dearing House, 1 Young Street, Sheffield, S1 4UP This email has been scanned by the MessageLabs Email Security System. __
Re: [OT] Re: writing dynamic content using JspWriter out
2007/9/12, temp temp [EMAIL PROTECTED]: My applications writes html out of an xml file.this xml has feilds with there presentation type.This field element in xml can have cdata section which allows user to write any thing like scripts or bean tags or any other custom tag library ,html. for example field name=my-field presentation-type=text layout resource align=right ![CDATA[ span class=smallBlueText/ bean:write name=my-object/ ]] resource /layout /field I parse this information and use JspWiter to write.The probelm is, in cdata scetion the first part span class=smallBlueText/ works but the second line bean:write name=my-object/ does not work ie bean:write does not print value of my-object Is there any way I can reslve this If you haven't a JSP page, it won't be compiled! You could use FreeMarker, instead, that can be evaluated at every time. You can use JSP taglibs with FreeMarker: http://freemarker.org/docs/pgui_misc_servlet.html Antonio
JAAS struts 2 Tutorial?
Hello Everyone, I am looking for a tutorial for integrating JAAS into my Struts 2 + Hibernate Application. Can anyone point me to the right resources? Is JAAS the best way to go, or there are better alternates? If anyone thinks there are better alternates, can you provide me with the links to relevant tutorials? Regards, Muhammad Momin Rashid. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: writing dynamic content using JspWriter out
What if I use Iframe I tested it it worked do you see any problems using iframe ? Miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : My applications writes html out of an xml file.this xml has feilds with there presentation type.This field element in xml can have cdata section which allows user to write any thing like scripts or bean tags or any other custom tag library ,html. for example ]]-- I parse this information and use JspWiter to write.The probelm is, in cdata scetion the first partworks but the second linedoes not work ie bean:write does not print value of my-object Is there any way I can reslve this If you haven't a JSP page, it won't be compiled! You could use FreeMarker, instead, that can be evaluated at every time. You can use JSP taglibs with FreeMarker: http://freemarker.org/docs/pgui_misc_servlet.html Antonio - Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
Re: [OT] Re: writing dynamic content using JspWriter out
2007/9/12, temp temp [EMAIL PROTECTED]: What if I use Iframe I tested it it worked do you see any problems using iframe ? What do you put in the iframe? Antonio
Re: [OT] Re: writing dynamic content using JspWriter out
iframe src='/ext/application-digital-signature.jsp'/iframe miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : What if I use Iframe I tested it it worked do you see any problems using iframe ? What do you put in the iframe? Antonio - Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos more.
Re: [OT] Re: writing dynamic content using JspWriter out
field name=my-field presentation-type=text layout resource align=right ![CDATA[ span class=smallBlueText/ bean:write name=my-object/ ]] resource /layout /field In my resource Iinsteand of bean:write name=my-object/ I used iframe src='/ext/application-digital-signature.jsp'/iframe and in this jsp I used bean:write name=my-object/. This way i can write all my dynamic stuff in a in a jsp and call that jsp in iframe. miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : What if I use Iframe I tested it it worked do you see any problems using iframe ? What do you put in the iframe? Antonio - Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
Struts anchor question
I would like to display the URL link in a new window. How to obtain the equivalent html anchor in struts? s:property value= targets=_blank ... I tried with the targets parameter but it doesn't work. s:a href=%{url} targets=_blank ... /s:a Thanks in advance. -- View this message in context: http://www.nabble.com/Struts-anchor-question-tf4428755.html#a12633865 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: writing dynamic content using JspWriter out
It works, but it is not your original request... anyway if it is ok for you... 2007/9/12, temp temp [EMAIL PROTECTED]: field name=my-field presentation-type=text layout resource align=right ![CDATA[ span class=smallBlueText/ bean:write name=my-object/ ]] resource /layout /field In my resource Iinsteand of bean:write name=my-object/ I used iframe src='/ext/application-digital-signature.jsp'/iframe and in this jsp I used bean:write name=my-object/. This way i can write all my dynamic stuff in a in a jsp and call that jsp in iframe. miro Antonio Petrelli [EMAIL PROTECTED] wrote: 2007/9/12, temp temp : What if I use Iframe I tested it it worked do you see any problems using iframe ? What do you put in the iframe? Antonio - Catch up on fall's hot new shows on Yahoo! TV. Watch previews, get listings, and more!
Struts anchor question
I would like to display the URL link in a new window. How to obtain the equivalent html anchor in struts? .a href=s:property value=%{url}/ target=_blank ... ./a I tried with the targets parameter but it doesn't work. s:a href=%{url} targets=_blank ... /s:a Thanks in advance. -- View this message in context: http://www.nabble.com/Struts-anchor-question-tf4428839.html#a12634121 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts anchor question
--- TonyD [EMAIL PROTECTED] wrote: How to obtain the equivalent html anchor in struts? .a href=s:property value=%{url}/ target=_blank ... ./a I tried with the targets parameter but it doesn't work. s:a href=%{url} targets=_blank ... /s:a Why not just use an HTML a.../ tag with a URL created via s:url.../? d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Call Oracle stored function using Hibernate
Hi. I am using Spring, Struts 2, Hibernate and Oracle as DB. Until now everything worked ok since I only needed full entity objects but now I have to call some stored functions from the DB using the hibernate api. Until now I have used the following syntax: Query q = getEntityManager().createQuery(). Can you give me an example please on how to call a stored function ? Thank you. -- View this message in context: http://www.nabble.com/Call-Oracle-stored-function-using-Hibernate-tf4429022.html#a12634650 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Call Oracle stored function using Hibernate
2007/9/12, GEDA [EMAIL PROTECTED]: Hi. I am using Spring, Struts 2, Hibernate and Oracle as DB. Until now everything worked ok since I only needed full entity objects but now I have to call some stored functions from the DB using the hibernate api. Until now I have used the following syntax: Query q = getEntityManager().createQuery(). Can you give me an example please on how to call a stored function ? Ooookyy let's say altogether: this is a Struts forum, not an Hibernate forum! And BTW, I think this page can help: http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#sp_query (please do not reply to this email). Antonio
Re: JAAS struts 2 Tutorial?
Hi Muhammad, With respect to JAAS integration. Do you mean something like this? http://struts.apache.org/2.x/docs/how-do-i-obtain-security-details-jaas.html I'm new to Struts 2 but I would imagine you probably want an interceptor of some kind (RolesInterceptor, PrincipalAware etc.) to pass your authentication and authorization details into your Struts Actions. As regards Hibernate integration, I would imagine your best option would be to inject your Hibernate Data Access Object (DAO) into your Struts 2 application using Spring (or something like it, e.g. Guice). If you write your application following the usual IoC best practices you will end up with an application where it should be easy to replace Hibernate with something else (e.g. TopLink, iBATIS, JDBC[Template]). You should then be able to test this code away from the web and reuse it elsewhere. http://static.springframework.org/spring/docs/2.0.x/reference/orm.html#orm-hibernate http://struts.apache.org/2.0.9/docs/spring-plugin.html Alternatively here is an example of writing a Hibernate Aware Struts 2 Action. http://www.hibernate.org/51.html HTH Mark On 9/12/07, Muhammad Momin Rashid [EMAIL PROTECTED] wrote: Hello Everyone, I am looking for a tutorial for integrating JAAS into my Struts 2 + Hibernate Application. Can anyone point me to the right resources? Is JAAS the best way to go, or there are better alternates? If anyone thinks there are better alternates, can you provide me with the links to relevant tutorials? Regards, Muhammad Momin Rashid. -- Paradoxically, the more time saving abstractions you are using the more you actually have to know. - Simon Willison - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Call Oracle stored function using Hibernate
--- GEDA [EMAIL PROTECTED] wrote: now I have to call some stored functions from the DB using the hibernate api. You might want to ask this on a Hibernate list / forum or STFW with a query resembling hibernate +call stored proc or similar. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS struts 2 Tutorial?
Hello Mark, Thanks for your response. Actually I am writing a Web Application from Scratch, using Struts 2 and Hibernate. I need to implement security so that only authorised User can access the desired pages. The user names, passwords and their roles are stored in the database. I am looking for a tutorial that can guide me through implementation of JAAS based security for my web application. I am starting from scratch here. Regards, Muhammad Momin Rashid. Mark McLaren wrote: Hi Muhammad, With respect to JAAS integration. Do you mean something like this? http://struts.apache.org/2.x/docs/how-do-i-obtain-security-details-jaas.html I'm new to Struts 2 but I would imagine you probably want an interceptor of some kind (RolesInterceptor, PrincipalAware etc.) to pass your authentication and authorization details into your Struts Actions. As regards Hibernate integration, I would imagine your best option would be to inject your Hibernate Data Access Object (DAO) into your Struts 2 application using Spring (or something like it, e.g. Guice). If you write your application following the usual IoC best practices you will end up with an application where it should be easy to replace Hibernate with something else (e.g. TopLink, iBATIS, JDBC[Template]). You should then be able to test this code away from the web and reuse it elsewhere. http://static.springframework.org/spring/docs/2.0.x/reference/orm.html#orm-hibernate http://struts.apache.org/2.0.9/docs/spring-plugin.html Alternatively here is an example of writing a Hibernate Aware Struts 2 Action. http://www.hibernate.org/51.html HTH Mark On 9/12/07, Muhammad Momin Rashid [EMAIL PROTECTED] wrote: Hello Everyone, I am looking for a tutorial for integrating JAAS into my Struts 2 + Hibernate Application. Can anyone point me to the right resources? Is JAAS the best way to go, or there are better alternates? If anyone thinks there are better alternates, can you provide me with the links to relevant tutorials? Regards, Muhammad Momin Rashid. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [S2] validation issue
I don't know much about s1 validation, so I cannot do exactly what you did in s1. Here is the validator I use for s2 to make sure field 2 is required when field1 has value. You can use the expression validator most of the time. Hope it helps. validator type=expression param name=expression field1 == null || field2 != null /param message field 2 is required when field 1 is not null/message /validator -Original Message- From: j alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 4:28 PM To: Struts Users Mailing List Subject: Re: [S2] validation issue The fieldexpression validator would handle most dependent checks, but i think there's no out-of-the-box solution if we want the expression to act as a guard condition alone and not as a validation. Please check the archives for comments on this. -Joseph On 9/11/07, Jiang, Jane (NIH/NCI) [C] [EMAIL PROTECTED] wrote: Did you look into expression validator? -Original Message- From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 10:28 AM To: Struts Users Mailing List Subject: [S2] validation issue Hi all! I´m trying to validate two fields that depends on another field. What I was doing in S1 is (for field in): field property=in depends=requiredif msg name=validwhen key=ErrorMessages.applicationIdRepresent.sameReference/ arg position=0 key=ProcessorHTTPDetails.in/ msg name=mask key=ProcessorHTTPDetails.in.help/ var var-namefield[0]/var-name var-valueeditParams/var-value /var var var-namefieldTest[0]/var-name var-valueNOTNULL/var-value /var /field But now in S2, there is no requiredif validator :( Any idea about how can I do to get the same validation effect? Thanks. - 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: How to invalidate a session in struts 2.0
I'm not a purist myself, so it may break the MVC model somewhere, but (at lest in the apps I coded) I didn't find any use case that forced my to invalidate the session into a Logout action class. In addition, I like to present messages like Thank you Your Name here and this information is usually in session scope, so invalidating the session in the action class would force me to transfer this information into request scope just for showing in the logout page. 2007/9/11, Ray Clough [EMAIL PROTECTED]: The only thing wrong with it is that now you are putting application control logic in a jsp page, which is 'OK' for small apps, and is probably 'OK' in this particular instance if there are no complicating factors. However, for purists, it IS putting control logic in a jsp page, which purists do not view as 'OK' (speaking as a purist myself, while acknowledging this as a possible character flaw.). - Ray Clough - Original Message - From: Gabriel Belingueres [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to invalidate a session in struts 2.0 Date: Tue, 11 Sep 2007 16:16:41 -0300 Personally, I use the good old % session.invalidate(); % as the last instruction of my logout.jsp page. AFAIK, to invalidate the session inside an action, you must downcast the session Map (from the SessionAware interface) to a SessionMap class, which seems little awkward to me. Besides, using session.invalidate() doesn't seems to me like an anti-pattern or something wrong. Gabriel 2007/9/11, illusion [EMAIL PROTECTED]: Hey, How to invalidate a Http Sesssion in struts 2.0? There is a SessionMap class which asks for a httpservletrequest as a parameter, and has an invalidate method for the http session, not sure how this works. thanks in advance for your assistance -- View this message in context: http://www.nabble.com/How-to-invalidate-a-session-in-struts-2.0-tf4424331.html#a12620475 Sent from the Struts - User mailing list archive at Nabble.com. - 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] - Ray Clough [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: Struts anchor question
Because the HTML anchor a.../ tag with a URL created via s:url.../ replaces the character between parameters with amp; characters and my link doesn't work. newton.dave wrote: --- TonyD [EMAIL PROTECTED] wrote: How to obtain the equivalent html anchor in struts? .a href=s:property value=%{url}/ target=_blank ... ./a I tried with the targets parameter but it doesn't work. s:a href=%{url} targets=_blank ... /s:a Why not just use an HTML a.../ tag with a URL created via s:url.../? d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts-anchor-question-tf4428839.html#a12636331 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to invalidate a session in struts 2.0
I keep on saying that you can perform exactly the same with LogoutAction, but keeping away code from JSP. However, I agree that in very small apps is ok to do a little scripting. Alvaro. On 9/12/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: I'm not a purist myself, so it may break the MVC model somewhere, but (at lest in the apps I coded) I didn't find any use case that forced my to invalidate the session into a Logout action class. In addition, I like to present messages like Thank you Your Name here and this information is usually in session scope, so invalidating the session in the action class would force me to transfer this information into request scope just for showing in the logout page. 2007/9/11, Ray Clough [EMAIL PROTECTED]: The only thing wrong with it is that now you are putting application control logic in a jsp page, which is 'OK' for small apps, and is probably 'OK' in this particular instance if there are no complicating factors. However, for purists, it IS putting control logic in a jsp page, which purists do not view as 'OK' (speaking as a purist myself, while acknowledging this as a possible character flaw.). - Ray Clough - Original Message - From: Gabriel Belingueres [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to invalidate a session in struts 2.0 Date: Tue, 11 Sep 2007 16:16:41 -0300 Personally, I use the good old % session.invalidate(); % as the last instruction of my logout.jsp page. AFAIK, to invalidate the session inside an action, you must downcast the session Map (from the SessionAware interface) to a SessionMap class, which seems little awkward to me. Besides, using session.invalidate() doesn't seems to me like an anti-pattern or something wrong. Gabriel 2007/9/11, illusion [EMAIL PROTECTED]: Hey, How to invalidate a Http Sesssion in struts 2.0? There is a SessionMap class which asks for a httpservletrequest as a parameter, and has an invalidate method for the http session, not sure how this works. thanks in advance for your assistance -- View this message in context: http://www.nabble.com/How-to-invalidate-a-session-in-struts-2.0-tf4424331.html#a12620475 Sent from the Struts - User mailing list archive at Nabble.com. - 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] - Ray Clough [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] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts anchor question
http://struts.apache.org/2.x/docs/url.html --- TonyD [EMAIL PROTECTED] wrote: Because the HTML anchor a.../ tag with a URL created via s:url.../ replaces the character between parameters with amp; characters and my link doesn't work. newton.dave wrote: --- TonyD [EMAIL PROTECTED] wrote: How to obtain the equivalent html anchor in struts? .a href=s:property value=%{url}/ target=_blank ... ./a I tried with the targets parameter but it doesn't work. s:a href=%{url} targets=_blank ... /s:a Why not just use an HTML a.../ tag with a URL created via s:url.../? d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Struts-anchor-question-tf4428839.html#a12636331 Sent from the Struts - User mailing list archive at Nabble.com. - 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: Struts anchor question
Because the HTML anchor a.../ tag with a URL created via s:url.../ replaces the character between parameters with amp; characters and my link doesn't work. It should. The xhtml spec insists on that, and it works just fine in the browsers my employer lets us run (IE6, Netscape 7). -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts anchor question
Hello list, I saw datetimepicker is a very func in the tutorial. However, when I tried this: s:datetimepicker name=delivery.date label=Delivery Date format=#-#MM-#dd / I got the following exceptions, my version is struts.2.0.9, should I use other jar file or only struts2.1 provides this func: Thanks a lot! org.apache.jasper.JasperException: /Test.jsp(33,0) Attribute format invalid for tag datetimepicker according to TLD org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:236) org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:986) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:706) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214) org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:726) org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1442) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164) org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2214) org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2220) org.apache.jasper.compiler.Node$Root.accept(Node.java:457) org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2164) org.apache.jasper.compiler.Validator.validate(Validator.java:1484) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:167) org.apache.jasper.compiler.Compiler.compile(Compiler.java:296) org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Taglib documentation
What's with the taglib reference docs (at least for Struts 1.x). The 1.3.8 HTML taglib doc, for example, at http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#struts-ht ml.tld There are all kinds of what should be HTML tags and entities showing up: p, code, strong, lt;gt; on and on. It makes the doc nearly unreadable. Can this be fixed? -- Tim Slattery [EMAIL PROTECTED]
Re: Taglib documentation
2007/9/12, Slattery, Tim - BLS [EMAIL PROTECTED]: What's with the taglib reference docs (at least for Struts 1.x). The 1.3.8 HTML taglib doc, for example, at http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#struts-ht ml.tld There are all kinds of what should be HTML tags and entities showing up: p, code, strong, lt;gt; on and on. It makes the doc nearly unreadable. Can this be fixed? It *is* fixed, see the taglibdoc: http://struts.apache.org/1.3.8/struts-taglib/tlddoc/index.html Antonio
Based on struts 1.3.8 , now adding 2.0.9 jar to use funcs from 2.x
Hello List, I am using struts1.3.8. May I know is it possible that I can use some functions/tags provided by 2.0.9. For example, . do not change any 1.3.8 .jar files . Add struts2-core-2.0.9.jar xwork-2.0.4.jar ognl-2.6.11.jar And then use s:datetimepicker name=delivery.date label=Delivery Date format=#-#MM-#dd / ? Thanks a lot! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS struts 2 Tutorial?
Muhammad, Starting out from scratch should you use JAAS? I'm not a JAAS expert (I tend to use JASIG CAS which uses JAAS internally and SecurityFilter) but I imagine it all depends on your circumstances. From what I can gather if you need to reuse the exact same login mechanism for desktop applications, command line applications, applets, web applications and such then it is probably worth the effort to create a JAAS LoginModule and configure your web application to use that. Granted JAAS is a standard mechanism but it looks like it can be a complex mechanism at times. If your application is only ever going to be a web application then you are probably justified in producing a simpler homegrown solution (at least to start with). The example below shows one way to create a Struts 2 login interceptor using Spring. http://www.vitarara.org/cms/struts_2_cookbook/creating_a_login_interceptor In the example above the actual authentication is conducted by a Spring bean (securityManager). Using Spring's JDBCTemplates, LDAPTemplates, HibernateTemplate it is fairly simple to create beans that access various datasources in various ways. It would also be easy enough to extend the securityManager to access role information. Of course you can always access your JAAS login module via your Spring bean a later date if you so choose. HTH Mark On 9/12/07, Muhammad Momin Rashid [EMAIL PROTECTED] wrote: Hello Mark, Thanks for your response. Actually I am writing a Web Application from Scratch, using Struts 2 and Hibernate. I need to implement security so that only authorised User can access the desired pages. The user names, passwords and their roles are stored in the database. I am looking for a tutorial that can guide me through implementation of JAAS based security for my web application. I am starting from scratch here. Regards, Muhammad Momin Rashid. -- Paradoxically, the more time saving abstractions you are using the more you actually have to know. - Simon Willison - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
datetimepicker with displayFormat always return error msg?
Hello List, Tried datetimepicker, whenever I give the displayFormat=-MM-dd, always get the following warning: Invalid field value for field todayDate. Something wrong with my code? my code: s:datetimepicker name=todayDate label=TestDate (-MM-dd) displayFormat=-MM-dd/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found
Try putting those tld's in your webapp's WEB-INF directory. And then make sure you have those listed them in you web.xml file. Not neccessarily in WEB-INF but just making sure they are there for sure. Should have something similar in your web.xml. jsp-config taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/struts-nested.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-template.tld/ taglib-uri taglib-location/WEB-INF/struts-template.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/ taglib-location /taglib /jsp-config H. Mehmood, Qaiser [EMAIL PROTECTED] 09/12/2007 09:24 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found I am using Struts 1.1 with Java 1.4 and Tomcat 5.0.28 and getting this error: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :411) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :118) org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl. java:159) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) net.sf.deadbolt.DeadboltFilter.doFilter(DeadboltFilter.java:471) I verified struts tag libraries are in C:/struts/taglibs/... Any idea why its not loading these libraries. Please help. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 ForwardSourceID:NTB3F6
RE: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found
Yes I tried them in WEB-INF also. Same problem... :) Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:31 AM To: Struts Users Mailing List Subject: Re: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found Try putting those tld's in your webapp's WEB-INF directory. And then make sure you have those listed them in you web.xml file. Not neccessarily in WEB-INF but just making sure they are there for sure. Should have something similar in your web.xml. jsp-config taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/struts-nested.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-template.tld/ taglib-uri taglib-location/WEB-INF/struts-template.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/ taglib-location /taglib /jsp-config H. Mehmood, Qaiser [EMAIL PROTECTED] 09/12/2007 09:24 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found I am using Struts 1.1 with Java 1.4 and Tomcat 5.0.28 and getting this error: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :411) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :118) org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl. java:159) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) net.sf.deadbolt.DeadboltFilter.doFilter(DeadboltFilter.java:471) I verified struts tag libraries are in C:/struts/taglibs/... Any idea why its not loading these libraries. Please help. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 ForwardSourceID:NTB3F6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: datetimepicker with displayFormat always return error msg?
Are you running it under Struts 2? --- Emi Lu [EMAIL PROTECTED] wrote: Hello List, Tried datetimepicker, whenever I give the displayFormat=-MM-dd, always get the following warning: Invalid field value for field todayDate. Something wrong with my code? my code: s:datetimepicker name=todayDate label=TestDate (-MM-dd) displayFormat=-MM-dd/ - 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: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found
With: - The TLDs in your WEB-INF and - the same WEB-INF path in your JSP it didn't work?! d. --- Mehmood, Qaiser [EMAIL PROTECTED] wrote: Yes I tried them in WEB-INF also. Same problem... :) Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:31 AM To: Struts Users Mailing List Subject: Re: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found Try putting those tld's in your webapp's WEB-INF directory. And then make sure you have those listed them in you web.xml file. Not neccessarily in WEB-INF but just making sure they are there for sure. Should have something similar in your web.xml. jsp-config taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/struts-nested.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-template.tld/ taglib-uri taglib-location/WEB-INF/struts-template.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/ taglib-location /taglib /jsp-config H. Mehmood, Qaiser [EMAIL PROTECTED] 09/12/2007 09:24 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found I am using Struts 1.1 with Java 1.4 and Tomcat 5.0.28 and getting this error: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :411) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :118) org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl. java:159) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) net.sf.deadbolt.DeadboltFilter.doFilter(DeadboltFilter.java:471) I verified struts tag libraries are in C:/struts/taglibs/... Any idea why its not loading these libraries. Please help. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 ForwardSourceID:NTB3F6 - 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: JAAS struts 2 Tutorial?
Hi Muhammad, Try searching my messages chronologically and you'll get plenty to start with! Muhammad Momin Rashid-2 wrote: Hello Everyone, I am looking for a tutorial for integrating JAAS into my Struts 2 + Hibernate Application. Can anyone point me to the right resources? Is JAAS the best way to go, or there are better alternates? If anyone thinks there are better alternates, can you provide me with the links to relevant tutorials? Regards, Muhammad Momin Rashid. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/JAAS-struts-2-Tutorial--tf4428234.html#a12639734 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found
Yes it didn't. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:53 AM To: Struts Users Mailing List Subject: RE: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found With: - The TLDs in your WEB-INF and - the same WEB-INF path in your JSP it didn't work?! d. --- Mehmood, Qaiser [EMAIL PROTECTED] wrote: Yes I tried them in WEB-INF also. Same problem... :) Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:31 AM To: Struts Users Mailing List Subject: Re: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found Try putting those tld's in your webapp's WEB-INF directory. And then make sure you have those listed them in you web.xml file. Not neccessarily in WEB-INF but just making sure they are there for sure. Should have something similar in your web.xml. jsp-config taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/struts-nested.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-template.tld/ taglib-uri taglib-location/WEB-INF/struts-template.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/ taglib-location /taglib /jsp-config H. Mehmood, Qaiser [EMAIL PROTECTED] 09/12/2007 09:24 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found I am using Struts 1.1 with Java 1.4 and Tomcat 5.0.28 and getting this error: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :411) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :118) org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl. java:159) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) net.sf.deadbolt.DeadboltFilter.doFilter(DeadboltFilter.java:471) I verified struts tag libraries are in C:/struts/taglibs/... Any idea why its not loading these libraries. Please help. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 ForwardSourceID:NTB3F6 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL
Re: [S2] validation issue
Thank you. It works :) Jiang, Jane (NIH/NCI) [C] escribió: I don't know much about s1 validation, so I cannot do exactly what you did in s1. Here is the validator I use for s2 to make sure field 2 is required when field1 has value. You can use the expression validator most of the time. Hope it helps. validator type=expression param name=expression field1 == null || field2 != null /param message field 2 is required when field 1 is not null/message /validator -Original Message- From: j alex [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 4:28 PM To: Struts Users Mailing List Subject: Re: [S2] validation issue The fieldexpression validator would handle most dependent checks, but i think there's no out-of-the-box solution if we want the expression to act as a guard condition alone and not as a validation. Please check the archives for comments on this. -Joseph On 9/11/07, Jiang, Jane (NIH/NCI) [C] [EMAIL PROTECTED] wrote: Did you look into expression validator? -Original Message- From: Pablo Vázquez Blázquez [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 11, 2007 10:28 AM To: Struts Users Mailing List Subject: [S2] validation issue Hi all! I´m trying to validate two fields that depends on another field. What I was doing in S1 is (for field in): field property=in depends=requiredif msg name=validwhen key=ErrorMessages.applicationIdRepresent.sameReference/ arg position=0 key=ProcessorHTTPDetails.in/ msg name=mask key=ProcessorHTTPDetails.in.help/ var var-namefield[0]/var-name var-valueeditParams/var-value /var var var-namefieldTest[0]/var-name var-valueNOTNULL/var-value /var /field But now in S2, there is no requiredif validator :( Any idea about how can I do to get the same validation effect? Thanks. - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RolesInterceptor - how to use annotations
I am trying to use the RolesInterceptor to limit actions to certain roles. Is there a way to use annotations to define the roles on an action by action basis? Or, if annotations are not yet implemented for this interceptor, how difficult is it to create them? Can anyone orientate me on the way to create new annotations? -- View this message in context: http://www.nabble.com/RolesInterceptor---how-to-use-annotations-tf4430731.html#a12639926 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Proper way to access action from JSP
I am teaching myself Struts 2 after using Struts 1. In Struts 1 I would access data from the action form in my jsp using the bean tag (ex. bean:define name=myForm id=myForm scope=session/ ). However Struts 2 seems to have merged the action class with the action form so I am not sure how to access this now. I know there is the s:property/ tag but I want to assign the value in the jsp such as this... !-- Example Struts.xml -- struts package name=default namespace= action name=MyTestDisplay class=mypackage.MyTestDisplay result/web/mytest.jsp/result /package /struts !-- mypackage.MyTestDisplay.java -- public class MyTestDisplay extends ActionSupport { ListInteger list1 = new ArrayListString(); public String execute() throws Exception { list1.add( 1 ); list2.add( 2 ); list1.add( 3 ); list2.add( 4 ); return SUCCESS; } public List getList1() { return list1; } } !-- mytest.jsp -- html %@ taglib prefix=s uri=/struts-tags % table tr td % ListInteger myList = MyTestDisplay.getList1(); !-- HOW DO I DO THIS -- for ( Integer i : myData ) { if ( (i % 2) == 0 ) { out.print( i ); } } % /td /tr html (I just threw together this example on the fly so sorry if there is a mistake but I am only conserned with the line that has the bold comment) -- View this message in context: http://www.nabble.com/Proper-way-to-access-action-from-JSP-tf4430767.html#a12640050 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found
Post the relevant portions of your web.xml and JSP. --- Mehmood, Qaiser [EMAIL PROTECTED] wrote: Yes it didn't. Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: Dave Newton [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:53 AM To: Struts Users Mailing List Subject: RE: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found With: - The TLDs in your WEB-INF and - the same WEB-INF path in your JSP it didn't work?! d. --- Mehmood, Qaiser [EMAIL PROTECTED] wrote: Yes I tried them in WEB-INF also. Same problem... :) Thanks, Qaiser Mehmood Work (512) 248-4269 Cell (571) 438-8639 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 11:31 AM To: Struts Users Mailing List Subject: Re: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found Try putting those tld's in your webapp's WEB-INF directory. And then make sure you have those listed them in you web.xml file. Not neccessarily in WEB-INF but just making sure they are there for sure. Should have something similar in your web.xml. jsp-config taglib taglib-uri/WEB-INF/struts-bean.tld/taglib-uri taglib-location/WEB-INF/struts-bean.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-html.tld/taglib-uri taglib-location/WEB-INF/struts-html.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-logic.tld/taglib-uri taglib-location/WEB-INF/struts-logic.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-nested.tld/taglib-uri taglib-location/WEB-INF/struts-nested.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-template.tld/ taglib-uri taglib-location/WEB-INF/struts-template.tld/ taglib-location /taglib taglib taglib-uri/WEB-INF/struts-tiles.tld/taglib-uri taglib-location/WEB-INF/struts-tiles.tld/ taglib-location /taglib /jsp-config H. Mehmood, Qaiser [EMAIL PROTECTED] 09/12/2007 09:24 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found I am using Struts 1.1 with Java 1.4 and Tomcat 5.0.28 and getting this error: org.apache.jasper.JasperException: File C:/struts/taglibs/struts-bean.tld not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand ler.java:50) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java :411) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java :118) org.apache.jasper.compiler.TagLibraryInfoImpl.init(TagLibraryInfoImpl. java:159) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539) org.apache.jasper.compiler.Parser.parse(Parser.java:126) org.apache.jasper.compiler.ParserController.doParse(ParserController.jav a:220) org.apache.jasper.compiler.ParserController.parse(ParserController.java: 101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203) org.apache.jasper.compiler.Compiler.compile(Compiler.java:470) org.apache.jasper.compiler.Compiler.compile(Compiler.java:451) org.apache.jasper.compiler.Compiler.compile(Compiler.java:439) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja va:511) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:295) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) === message truncated === - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Taglib documentation
What's with the taglib reference docs (at least for Struts 1.x). The 1.3.8 HTML taglib doc, for example, at http://struts.apache.org/1.3.8/struts-taglib/tagreference.html#struts- ht ml.tld There are all kinds of what should be HTML tags and entities showing up: p, code, strong, lt;gt; on and on. It makes the doc nearly unreadable. Can this be fixed? It *is* fixed, see the taglibdoc: http://struts.apache.org/1.3.8/struts-taglib/tlddoc/index.html That one doesn't look very good either. The text lines don't wrap, I have to scroll nearly forever to get to the end of a line, then come way back to the left edge to see the next one. Besides it's a Javadoc, not a reference doc that tells just what each option does in your JSP page. Hmm...actually there's one line at the top (Many of the tags in this page...) that goes forever to the right. That one line makes it impossible to size the rest of the page as I'd like. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Taglib documentation
On 9/12/07, Slattery, Tim - BLS [EMAIL PROTECTED] wrote: That one doesn't look very good either. The text lines don't wrap, I have to scroll nearly forever to get to the end of a line, then come way back to the left edge to see the next one. Besides it's a Javadoc, not a reference doc that tells just what each option does in your JSP page. Hmm...actually there's one line at the top (Many of the tags in this page...) that goes forever to the right. That one line makes it impossible to size the rest of the page as I'd like. At one point we were tracking several bugs in Taglibdoc that were affecting our site. Might be worth reviewing those and making sure we're using the latest version. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: datetimepicker with displayFormat always return error msg?
Are you running it under Struts 2? Tried datetimepicker, whenever I give the displayFormat=-MM-dd, always get the following warning: Invalid field value for field todayDate. Something wrong with my code? my code: s:datetimepicker name=todayDate label=TestDate (-MM-dd) displayFormat=-MM-dd/ I am using struts 2 . If I change to: s:datetimepicker name=todayDate label=TestDate (-MM-dd) / without display format, no warning msg at all. But if the displayFormat is added, warning msg is listed. How come? I am totally confused. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Taglib documentation
Wendy, I would like to fix this in 1.3.10 but I'll have to check if there is new version out. I did log a defect a long time ago and the last time I checked it had no work. I wonder who we can bug to get it fixed :-) Paul On 9/12/07, Wendy Smoak [EMAIL PROTECTED] wrote: On 9/12/07, Slattery, Tim - BLS [EMAIL PROTECTED] wrote: That one doesn't look very good either. The text lines don't wrap, I have to scroll nearly forever to get to the end of a line, then come way back to the left edge to see the next one. Besides it's a Javadoc, not a reference doc that tells just what each option does in your JSP page. Hmm...actually there's one line at the top (Many of the tags in this page...) that goes forever to the right. That one line makes it impossible to size the rest of the page as I'd like. At one point we were tracking several bugs in Taglibdoc that were affecting our site. Might be worth reviewing those and making sure we're using the latest version. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionAware vs ActionContext access to session - confused..
On Tuesday 11 September 2007 23:03, Nils-Helge Garli wrote: You could, but I would recommend using the *Aware interfaces in your actions. It makes them easier to test. Hmm.. I've always handled session data by creating an application base action that implements a getUserData() and a setUserData() method. All my actions extend this base action. I then use an interceptor to grab the session data build whatever object I decide to use to hold the data and inject it into the base action. In this way, all my actions can simply getUserData() without having to care where the data comes from. Is this bad practice or just a matter of personal preference? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Iterate Hashmap with s:iterate
I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory
RE: Iterate Hashmap with s:iterate
If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Iterate Hashmap with s:iterate
IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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: Iterate Hashmap with s:iterate
Dave, Where did you find the documentation on the pseudo-property? On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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: Iterate Hashmap with s:iterate
The OGNL manual. http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html --- Cory D. Wiles [EMAIL PROTECTED] wrote: Dave, Where did you find the documentation on the pseudo-property? On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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: Iterate Hashmap with s:iterate
It is still not working the way that I want to, but I do appreciate the help. I'll just have to keep plugging away at it. Thanks, Cory On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: The OGNL manual. http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html --- Cory D. Wiles [EMAIL PROTECTED] wrote: Dave, Where did you find the documentation on the pseudo-property? On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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: Default tab in tabbedPanel loaded twice
Hmmm, Do you have a real simple test using 2.0.6 vs 2.0.8? I recall the problem was eliminated at the 2.0.8. We only changed to 2.0.9 to get the security fix. On 9/11/07, Alvaro Sanchez-Mariscal [EMAIL PROTECTED] wrote: I'm using 2.0.8. I will try 2.0.9 right now. Alvaro. On 9/11/07, Marco Carnevale [EMAIL PROTECTED] wrote: Back to your original issue. The loading of the default tab twice seems to have been resolved in 2.0.8 and/or 2.0.9. I used to have the same problem using 2.0.6 until I upgraded. Marco On 9/10/07, Alvaro Sanchez-Mariscal [EMAIL PROTECTED] wrote: Any help on this? In a page with 6 tabs, 6 requests are made, and browser get freezed. autoStart=false doesn'w work. Is there another way to prevent tab preloading? https://issues.apache.org/struts/browse/WW-2166 Alvaro. On 8/19/07, Alvaro Sanchez-Mariscal [EMAIL PROTECTED] wrote: Here is a screenshot of firebug: http://www.upload-images.net/imagen/7915ac25eb.gif On 8/19/07, Alvaro Sanchez-Mariscal [EMAIL PROTECTED] wrote: Hi, I have the following tabbed panel: s:tabbedPanel id=panel c:choose c:when test=${sessionScope.user.departmentMember} s:div id=myTab label=Mis acogidas autoStart=false theme=ajax href=%{my} cssStyle=margin: 10px 10px 10px 10px; listenTopics=/refresh executeScripts=true refreshOnShow=true/ s:div id=newTab label=Nueva acogida theme=ajax href=%{new} cssStyle=margin: 10px 10px 10px 10px; refreshOnShow=true/ /c:when c:otherwise s:div id=currentTab label=Acogidas en curso theme=ajax href=%{current} cssStyle=margin: 10px 10px 10px 10px; executeScripts=true/ s:div id=searchTab label=Consultas autoStart=false theme=ajax href=%{search} cssStyle=margin: 10px 10px 10px 10px; refreshOnShow=true/ c:if test=${sessionScope.user.admin} s:div id=adminTab label=Administracioacute;n autoStart=false theme=ajax href=%{admin} cssStyle=margin: 10px 10px 10px 10px;/ /c:if /c:otherwise /c:choose /s:tabbedPanel (s:url's for href attributes omitted). When the page first load, all tabs are requested in background, and the default one (the first, myTab or currentTab in my case) is requested another time. I have tried with autoStart=false, but it doesn't work. What's wrong? Alvaro. -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterate Hashmap with s:iterate
Looking through some code here, this is what I have: s:iterator value=map.entrySet() s:property value=%{key}/ s:property value=%{value}/ /s:iterator The above seems to work OK, though I'm a little curious about the inclusion of the double parentheses at the end of entrySet -- OGNL, as far as I am concerned, is a bit of strange beast. Josh On 9/12/07, Cory D. Wiles [EMAIL PROTECTED] wrote: It is still not working the way that I want to, but I do appreciate the help. I'll just have to keep plugging away at it. Thanks, Cory On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: The OGNL manual. http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html --- Cory D. Wiles [EMAIL PROTECTED] wrote: Dave, Where did you find the documentation on the pseudo-property? On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterate Hashmap with s:iterate
--- Josh Vickery [EMAIL PROTECTED] wrote: I'm a little curious about the inclusion of the double parentheses at the end of entrySet -- OGNL, as far as I am concerned, is a bit of strange beast. It's a method call -- not property access. d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Iterate Hashmap with s:iterate
That worked perfectly. Thanks everyone for all the help. -Cory On 9/12/07, Josh Vickery [EMAIL PROTECTED] wrote: Looking through some code here, this is what I have: s:iterator value=map.entrySet() s:property value=%{key}/ s:property value=%{value}/ /s:iterator The above seems to work OK, though I'm a little curious about the inclusion of the double parentheses at the end of entrySet -- OGNL, as far as I am concerned, is a bit of strange beast. Josh On 9/12/07, Cory D. Wiles [EMAIL PROTECTED] wrote: It is still not working the way that I want to, but I do appreciate the help. I'll just have to keep plugging away at it. Thanks, Cory On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: The OGNL manual. http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html --- Cory D. Wiles [EMAIL PROTECTED] wrote: Dave, Where did you find the documentation on the pseudo-property? On 9/12/07, Dave Newton [EMAIL PROTECTED] wrote: IIRC OGNL supplies a pseudo-property keys that will return a list of keys present in the map. --- Wesley Wannemacher [EMAIL PROTECTED] wrote: If I remember correctly, to use the s:iterator tag, you have to use an object that has an 'iterator()' method. HashMap does not implement java.util.List... To iterate over a Hashmap, get the keyset [tempMap.ketSet()] from it. The keyset is a List and you can get an iterator from there. -Wes -Original Message- From: Cory D. Wiles [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 12, 2007 2:28 PM To: user@struts.apache.org Subject: Iterate Hashmap with s:iterate I have an action that returns a hash map that I need to output both the key and value, but I can't figure out how to access each property with s:iterate. Any suggestions would help. The HashMap is being set in my action and returned populated (verified with s:debug/). // Action snippet Iterator categoryPhysPropsItr = getCategoryPhysProps().iterator(); Map tempMap = new HashMap(); tempMap = new TreeMap(); while (categoryPhysPropsItr.hasNext()) { DruglistDrugproperty prop = new DruglistDrugproperty(); prop = (DruglistDrugproperty) categoryPhysPropsItr.next(); tempMap.put(prop.getDruglistDrugclass().getDrugClassName(), prop.getDrugService()); } setDrugClassPropsSrvc(tempMap); // HashMap that needs to be iterated through // end Action Snippet // Display JSP s:iterator value=drugClassPropsSrvc status=status Key (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/)br/ Value (s:property value=%{drugClassPropsSrvc['+#status.index+'].value}/) br/ /s:iterator // end Display JSP Thanks, Cory - 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parameter Mapping with Set elements
On 6/10/07, Dave Newton [EMAIL PROTECTED] wrote: --- Nicolás Pace [EMAIL PROTECTED] wrote: The point here is that Sets are not indexable, so i can't name elements by their unique id... Let me rephrase: I don't know how you'd be able to use a Set directly on a web page simply because it's *not* indexable. My guess is that you'd have to massage between a collection of some sort and the set you want, but perhaps someone else has another suggestion. I will answer myself, as usual The problem was that I was badly reimplementing the equals method. Because of that it was not inserting both of the elements!!! Thanks to all!! *Nico d. Shape Yahoo! in your own image. Join our Network Research Panel today! http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 - 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]
Struts2 select taglib
I mostly have experience with original struts. But now I am attempting to use Struts 2. I am trying to figure out how I can populate the select tag. I have created an action class, called Blast with the following attributes: 1. ListDatabase databases = new ArrayList(); There are two methods, getDatabases and setDatabases I have created another class called Database with the following attributes: 1. int id 2. String database 3. String databasetype I want to use the select tag to access the List of Database objects in the action class Blast This is how I am using the action class: s:select name=database list=databases listKey=id listValue=database emptyOption=true/s:select As you can see, I specify the list equal to databases which should correspond to getDatabases in my action class, Blast. My listKey is equal to id, which should correspond to the id field in my Database class. And finally, listValue should correspond to database in my Database class. My jsp page fails to compile/execute giving errors like: /view/Index.jsp(55,87) Unterminated lt;s:select tag or -- Randall Svancara System Administrator Horticulture and Landscape Architecture 509-335-7093 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts2 select taglib
SORRY, I SENT THIS TOO EARLY I mostly have experience with original struts. But now I am attempting to use Struts 2. I am trying to figure out how I can populate the select tag. I have created an action class, called Blast with the following attributes: 1. ListDatabase databases = new ArrayList(); There are two methods, getDatabases and setDatabases I have created another class called Database with the following attributes: 1. int id 2. String database 3. String databasetype I want to use the select tag to access the List of Database objects in the action class Blast.java This is how I am using the action class: s:select name=database list=databases listKey=id listValue=database emptyOption=true/s:select As you can see, I specify the list equal to databases which should correspond to getDatabases in my action class, Blast. My listKey is equal to id, which should correspond to the id field in my Database class. And finally, listValue should correspond to database in my Database class. My jsp page fails to compile/execute giving errors like: /view/Index.jsp(55,87) Unterminated lt;s:select tag or org.apache.jasper.JasperException: Unable to load class for JSP I am including copies of the files in case someone is kind enough to help a pathetic newbie out with this. BLAST.Java mport java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.struts2.ServletActionContext; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.Validateable; import com.opensymphony.xwork2.util.ValueStack; import edu.wsu.bioinfo.domain.Database; import org.apache.log4j.Logger; public class Blast extends MainLabSupport { static final long serialVersionUID=1L; private static Logger logger = Logger.getLogger(Blast.class); private String title; private String emailaddress; private String database; private ListDatabase databases = new ArrayList(); // Default Constructor public Blast(){ Database db1 = new Database(1, NCBI Fragaria EST, EST); Database db2 = new Database(2, NCBI Malus EST, EST); Database db3 = new Database(3, NCBI Prunus EST, EST); this.databases.add(db1); this.databases.add(db2); this.databases.add(db3); } public String execute() throws Exception { return INPUT; } /** * @return the title */ public String getTitle() { return title; } /** * @param title the title to set */ public void setTitle(String title) { this.title = title; } /** * @return the emailaddress */ public String getEmailaddress() { return emailaddress; } /** * @param emailaddress the emailaddress to set */ public void setEmailaddress(String emailaddress) { this.emailaddress = emailaddress; } /** * @return the database */ public String getDatabase() { return database; } /** * @param database the database to set */ public void setDatabase(String database) { this.database = database; } /** * @return the databases */ public ListDatabase getDatabases() { return databases; } /** * @param databases the databases to set */ public void setDatabases(ListDatabase databases) { this.databases = databases; } } Database.java public class Database { private int databaseid; private String database; private String databasetype; /** * Default Constructor */ public Database(){ } /** * Constructor with parameters * @param databaseid * @param database * @param databasetype */ public Database(int databaseid, String database, String databasetype){ this.databaseid = databaseid; this.database = database; this.databasetype = databasetype; } /** * @return the databaseid */ public int getDatabaseid() { return databaseid; } /** * @param databaseid the databaseid to set */ public void setDatabaseid(int databaseid) { this.databaseid = databaseid; } /** * @return the database */ public String getDatabase() {
Any idea how the tree viewer in this link is created? Or how I could get it
Hi, Yet another tree question, but one more interested. I found the type of tree viewer I wanted, it's like the one on this IBM link: http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.exp.doc/info/exp/ae/rxml_propscript.html If you have any ideas how that tree is created, or what tool is used, please let me know. Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Any idea how the tree viewer in this link is created? Or how I could get it
--- Session A Mwamufiya wrote: If you have any ideas how that tree is created, or what tool is used, please let me know. If the Dojo treeview isn't what you want try searching the web for tree controls; there's a million of them (figuratively speaking). d. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to invalidate a session in struts 2.0
I agree too that (generally speaking) we must introduce the least possible quantity of scripting into JSP pages as we can, so we honor the MVC architecture, however, in this particular case (invalidating the session), I don't understand why would be better to do it in the action class rather than in the JSP page for non-small apps. In addition, the preferred way of manipulating the session in S2 is by implementing SessionAware interface, and what is really injected into the action is a Map (I guess that it is this way so as actions will be more unit test friendly). Take a look to the code to invalidate a session: http://struts.apache.org/2.0.9/docs/how-do-we-get-invalidate-the-session.html Now regardless of if the app is small or very large, I don't know any use case scenario where invalidating the session inside the action class would produce less counter-productive effects than doing it in the JSP page (beyond of course purist arguments like it breaks our system architecture document). 2007/9/12, Alvaro Sanchez-Mariscal [EMAIL PROTECTED]: I keep on saying that you can perform exactly the same with LogoutAction, but keeping away code from JSP. However, I agree that in very small apps is ok to do a little scripting. Alvaro. On 9/12/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: I'm not a purist myself, so it may break the MVC model somewhere, but (at lest in the apps I coded) I didn't find any use case that forced my to invalidate the session into a Logout action class. In addition, I like to present messages like Thank you Your Name here and this information is usually in session scope, so invalidating the session in the action class would force me to transfer this information into request scope just for showing in the logout page. 2007/9/11, Ray Clough [EMAIL PROTECTED]: The only thing wrong with it is that now you are putting application control logic in a jsp page, which is 'OK' for small apps, and is probably 'OK' in this particular instance if there are no complicating factors. However, for purists, it IS putting control logic in a jsp page, which purists do not view as 'OK' (speaking as a purist myself, while acknowledging this as a possible character flaw.). - Ray Clough - Original Message - From: Gabriel Belingueres [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: How to invalidate a session in struts 2.0 Date: Tue, 11 Sep 2007 16:16:41 -0300 Personally, I use the good old % session.invalidate(); % as the last instruction of my logout.jsp page. AFAIK, to invalidate the session inside an action, you must downcast the session Map (from the SessionAware interface) to a SessionMap class, which seems little awkward to me. Besides, using session.invalidate() doesn't seems to me like an anti-pattern or something wrong. Gabriel 2007/9/11, illusion [EMAIL PROTECTED]: Hey, How to invalidate a Http Sesssion in struts 2.0? There is a SessionMap class which asks for a httpservletrequest as a parameter, and has an invalidate method for the http session, not sure how this works. thanks in advance for your assistance -- View this message in context: http://www.nabble.com/How-to-invalidate-a-session-in-struts-2.0-tf4424331.html#a12620475 Sent from the Struts - User mailing list archive at Nabble.com. - 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] - Ray Clough [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] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [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: How to invalidate a session in struts 2.0
On 9/12/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: I agree too that (generally speaking) we must introduce the least possible quantity of scripting into JSP pages as we can, so we honor the MVC architecture, however, in this particular case (invalidating the session), I don't understand why would be better to do it in the action class rather than in the JSP page for non-small apps. In my view, it's a maintainability issue. If you keep all of your code in the .java files, except for one or two lines that are in scriplets, it becomes a nightmare for anyone else to maintain the code. They would never think to look in the .jsp files for Java code, because that's not where the logic lives and it slows down the whole process of maintaining the site, or bringing people up to speed to maintain the site, so you can go off and do the fun things. On a related note, I think SessionAware should be updated to return a SessionMap (which is a subclass of Map, so shouldn't require any recoding of existing apps) so that type-casting isn't required to invalidate the session. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to invalidate a session in struts 2.0
There is one extra reason in favour of doing in the action: it's really simple. Sure. You can implement ServletRequestAware, an call request.getSession().invalidate(); Alvaro. On 9/13/07, Chris Pratt [EMAIL PROTECTED] wrote: On 9/12/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: I agree too that (generally speaking) we must introduce the least possible quantity of scripting into JSP pages as we can, so we honor the MVC architecture, however, in this particular case (invalidating the session), I don't understand why would be better to do it in the action class rather than in the JSP page for non-small apps. In my view, it's a maintainability issue. If you keep all of your code in the .java files, except for one or two lines that are in scriplets, it becomes a nightmare for anyone else to maintain the code. They would never think to look in the .jsp files for Java code, because that's not where the logic lives and it slows down the whole process of maintaining the site, or bringing people up to speed to maintain the site, so you can go off and do the fun things. On a related note, I think SessionAware should be updated to return a SessionMap (which is a subclass of Map, so shouldn't require any recoding of existing apps) so that type-casting isn't required to invalidate the session. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Alvaro Sanchez-Mariscal Arnaiz Java EE Architect Instructor [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: file upload exception
Make sure you have commons-io, commons-fileupload, and commons-collections jar files in your WEB-INF/lib directory. At least this worked for me. Thanks, On Wed, 2007-09-12 at 19:07 -0400, Session A Mwamufiya wrote: Hi, I'm using struts 2.0.6, and I keep getting the following exception when I try to replicate the fileupload example in the showcase: Unable to load bean org.apache.struts2.dispatcher.multipart.MultiPartRequest (jakarta) - [unknown location] org.apache.struts2.config.BeanSelectionProvider$ObjectFactoryDelegateFactory.create(BeanSelectionProvider.java:247) com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:134) com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:476) com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:486) com.opensymphony.xwork2.inject.ContainerImpl$9.call(ContainerImpl.java:517) com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:542) com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:515) org.apache.struts2.dispatcher.Dispatcher.wrapRequest(Dispatcher.java:700) org.apache.struts2.dispatcher.FilterDispatcher.prepareDispatcherAndWrapRequest(FilterDispatcher.java:327) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:390) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) Here is my jsp: s:form action=SMIGImport method=POST enctype=multipart/form-data s:file name=upload label=File / s:submit key=importSMIGButton method=importSMIGButtonPressed / /s:form Here is my validation.xml: validators field name=upload field-validator type=fieldexpression param name=expression![CDATA[upload.length() 0]]/param messageFile cannot be empty/message /field-validator /field /validators If I remove enctype=multipart/form-data, I get the following error: Invalid field value for field upload. Any idea how to fix this? Does this have to do with my version of struts, or is there something that I'm missing. Thanks, Session - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Randall Svancara System Administrator Horticulture and Landscape Architecture 509-335-7093 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JAAS struts 2 Tutorial?
what exactly you are trying to do? --- Muhammad Momin Rashid [EMAIL PROTECTED] wrote: Hello Everyone, I am looking for a tutorial for integrating JAAS into my Struts 2 + Hibernate Application. Can anyone point me to the right resources? Is JAAS the best way to go, or there are better alternates? If anyone thinks there are better alternates, can you provide me with the links to relevant tutorials? Regards, Muhammad Momin Rashid. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Luggage? GPS? Comic books? Check out fitting gifts for grads at Yahoo! Search http://search.yahoo.com/search?fr=oni_on_mailp=graduation+giftscs=bz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionAware vs ActionContext access to session - confused..
Hi, If you are developing portlets with struts2 I doubt *Aware interfaces work properly, you have to do it differently. For example How we get a handler for Http request or session is not via *Aware interfaces for portlets. --- j alex [EMAIL PROTECTED] wrote: Hi, In the Struts 2 docs, it's recommended to implement SessionAware for accessing session within Action, but looking at some Webwork documentation, http://wiki.opensymphony.com/display/WW1/SessionAware+Actions - it seems to convey the opposite message . Please clarify : 1. Why accessing via ActionContext is not advisable ? 2. In SessionAware API doc it's said Note that using this interface makes the Action tied to a servlet environment, so it should be avoided if possible since things like unit testing will become more difficult. -- how is it tied to servlet env, since we are not having any HTTP-specific code in the Action but just a plain setSession(Map map) method? Thanks, Joseph Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionAware vs ActionContext access to session - confused..
Hmm.. I've always handled session data by creating an application base action that implements a getUserData() and a setUserData() method. All my actions extend this base action. I then use an interceptor to grab the session data build whatever object I decide to use to hold the data and inject it into the base action. In this way, all my actions can simply getUserData() without having to care where the data comes from. Is this bad practice or just a matter of personal preference? I hope it's not a bad idea, I do the exact same thing with my User =8^) But there are commonly other things stored in the session that you might need access to and, depending on the app, writing an Interceptor for each of them might be a bit much. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Call Oracle stored function using Hibernate
Well, calling SP's is not a Struts topic (don't care the version), of course it's for Hibernate or even Oracle!! Also, it has a lot to do with your persistence layer and Data Model design. Anyway, you have several ways to call an Oracle SP function, here you have two hints: a) Use Hibernate to map the SP using named query, as it is explained at http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#sp_query and follow as you know. b) Use standard code to call the SP and manage the return, something like this: . String errors = null; Connection con = myPersistence.getSession().connection(); try { CallableStatement cs = null; //a simple CallableStatement // now a call to the function with two parameters cs = con.prepareCall({? = call PKG_VALIDATIONS.FNC_VALID1(?,?)}); cs.registerOutParameter(1,Types.VARCHAR); //the type of return cs.setInt(2,2007); //the first param (a Int) cs.setString(3,Agust); //the second param cs.execute(); //execute the call errors = cs.getString(1); //get the result } . Of course it's a very small a simple example to validate some data using a Oracle SP function, and returning the errors found (if any) as a string. Well, just take care what you are returning and how are you waiting the return in your call. Of course, there some limitations on what you can return from Oracle SP function and what you can get in your java app or persistence model, these limitations apply always. Cya. -Mensaje original- De: GEDA [mailto:[EMAIL PROTECTED] Enviado el: Miércoles, 12 de Septiembre de 2007 06:50 a.m. Para: user@struts.apache.org Asunto: Call Oracle stored function using Hibernate Hi. I am using Spring, Struts 2, Hibernate and Oracle as DB. Until now everything worked ok since I only needed full entity objects but now I have to call some stored functions from the DB using the hibernate api. Until now I have used the following syntax: Query q = getEntityManager().createQuery(). Can you give me an example please on how to call a stored function ? Thank you. -- View this message in context: http://www.nabble.com/Call-Oracle-stored-function-using-Hibernate-tf4429022.html#a12634650 Sent from the Struts - User mailing list archive at Nabble.com. - 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]
[S2] Interceptor
Hi With the following struts.xml, package name=default extends=struts-default interceptors interceptor name=login class=XYZ / /interceptors action name=welcome class=welcomeAction interceptor-ref name=login / resultindex.jsp/result /action /package Will the interceptors configured in struts-default package be executed, followed by the login interceptor? Can we describe this behaviour in http://struts.apache.org/2.0.9/docs/interceptors.html as well? -- Hez - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
problem with logic:iterate...
hi, i am trying to get the collection object (Vector) form Action Class to my Jsp. I already set to my FormBean and i am getting an error as.. javax.servlet.jsp.JspException: Cannot find bean: X32Form in any scope my Action class is (X32Action.java): Vector lableGenVect = (Vector) xParser.xmlLableGen (Comm_vect); form.setLableParam (lableGenVect); my FormBean Class is (X32Form.java): public Vector getLableParam(){ return lableParam; } public void setLableParam(Vector lables){ this.lableParam = lables; System.out.println(X32 FORM __+lables); // I am able to set ie. i can print the values of the action class. } my jsp: - logic:iterate name=X32Form id=lableParam tr td bean:write name=X32Form property=lableParam/ /td /tr /logic:iterate thanQ, Ajay -- View this message in context: http://www.nabble.com/problem-with-%3Clogic%3Aiterate...-tf4433312.html#a12647969 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
nested:iterate Validator problem
Users, I have been googling like crazy to find a workaround, or fix, to the problem of Validator not working properly with nested:iterate fields. Below I have included what I am doing for the code incase I have something wrong. Please let me know if anyone knows anything. My field is set up as: field property=menuCategoryDescription indexedListProperty=menuCategories depends=required arg key=WineListForm.MenuCategory.menuCategoryDescription/ /field the part of my jsp: nested:iterate property=menuCategories name=WineListForm type=com.forwardspin.form.dining.MenuCategoryForm indexId=menuCategoryCounter nested:textarea property=menuCategoryDescription / /nested:iterate output to browser: textarea name=menuCategories[0].menuCategoryDescription/textarea textarea name=menuCategories[1].menuCategoryDescription/textarea textarea name=menuCategories[2].menuCategoryDescription/textarea javascript that is put in browser: function validateWineListForm(form) { if (bCancel) { return true; } else { var formValidationResult; formValidationResult = validateRequired(form) validateMask(form); return (formValidationResult == 1); } } function WineListForm_required () { this.a0 = new Array(menuDisplayDescription, Wine List Preamble is required., new Function (varName, this.mask=/^[a-zA-Z0-9\\\'\\,\\.\\-\\[\\]\\{\\}\\:\\;\\?\\/[EMAIL PROTECTED](\\)\\_\\+\\= ]*$/; return this[varName];)); } function WineListForm_mask () { this.a0 = new Array(menuDisplayDescription, Wine List Preamble is invalid., new Function (varName, this.mask=/^[a-zA-Z0-9\\\'\\,\\.\\-\\[\\]\\{\\}\\:\\;\\?\\/[EMAIL PROTECTED](\\)\\_\\+\\= ]*$/; return this[varName];)); } I am expecting the _required() function to also have menuCategoryDescription 0-2 added to the array. How would this be accomplished. Thank you for any help in advance! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
where can i download struts-layout.tld's
hi, i am trying to use struts-layout for demonstration of Grid model. so Can anybady tell me from where i can download the relevent supported file's needed to me. i am using struts 1.2.9 and jdk1.5.. thanQ for anyKind of help. Ajay -- View this message in context: http://www.nabble.com/where-can-i-download-struts-layout.tld%27s-tf4433591.html#a12648680 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] Interceptor
No they won't. Only the login interceptor will be called. hezjing wrote: Hi With the following struts.xml, package name=default extends=struts-default interceptors interceptor name=login class=XYZ / /interceptors action name=welcome class=welcomeAction interceptor-ref name=login / resultindex.jsp/result /action /package Will the interceptors configured in struts-default package be executed, followed by the login interceptor? Can we describe this behaviour in http://struts.apache.org/2.0.9/docs/interceptors.html as well? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SessionAware vs ActionContext access to session - confused..
Yes in theory you are correct, but in side a S2 portlet (which implements ServletRequestAware interface) if you try to get a handler for HttpServletRequest object via the setServletRequest method it basically gives null. How we make a handler for the HttpServletRequest object is as follows, PortletRequest portletRequest =PortletActionContext.getRequest(); request = (HttpServletRequest) portletRequest; there were lot of other things we had to do differently, but for all we got some solution. I thing this is a seperate discussion alltogether why it doesnt work like a web application etc? hope this helps --- Chris Pratt [EMAIL PROTECTED] wrote: On 9/12/07, tom tom [EMAIL PROTECTED] wrote: If you are developing portlets with struts2 I doubt *Aware interfaces work properly, you have to do it differently. I don't know of anything that would preclude you (or anyone else) from writing a set of Portlet aware Interceptors. They could even use the same *Aware interfaces. The advantage is that you could use the same actions whether or not they were in a Portlet by just changing the Interceptor Stack. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games. http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]