Problem using Artimus by Ted
Hi All, I am studying the code in Artimus_1_0 to make sure that I understand how things actually work. I tried running http://localhost:8080/artimus/index.jsp but got the following error javax.servlet.ServletException: Cannot create redirect URL: java.net.MalformedURLException: Cannot retrieve ActionForwards collection org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI mpl.java:846) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp l.java:779) org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:68) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3 25) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Can anyone please help me to make this application work. Here is the code.. The index.jsp of the application contains two lines: code: - %@ taglib uri=/tags/struts-logic prefix=logic % logic:redirect forward=welcome/ --- The code in struts-config is: --- global-forwards ... !-- MENU forwards -- forward name=welcome path=/do/Menu/ ... /global-forwards action path=/Menu name=menuForm type=org.apache.struts.scaffold.ExistsAttributeAction parameter=application;HOURS forward name=success path=.article.Menu/ forward name=failure path=/do/MenuCreate/ /action Tiles-def code is definition name=.article.Menu extends=.article.Base put name=title value=article.Menu.title/ put name=content value=/article/content/menu.jsp/ put name=navbarvalue=/article/common/navbarMenu.jsp/ /definition
RE: Html:muttibox tag help
I tried the below and the value of String [] resourceIds in my action form is still null. I have looked through many examples on using the multibox and just cannot see as to why the resourceIds array is not being populated. Help! -Original Message- From: Rafael Taboada [mailto:[EMAIL PROTECTED] Sent: 10 May 2005 14:14 Cc: user@struts.apache.org Subject: Re: Html:muttibox tag help Which object belongs resourceIds??? which form??? Let's suppose is searchForm so Try this: html:multibox name=searchForm property=resourceIds -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you Check us out at http://www.bt.com/consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multiple tiles layouts for single application
Hello, actually my solution is on page 16 ;) It's not that much to say about it, the example is quite straight forward. Just point the definition path to a struts action which will, based upon some condition, forward to a page or other tile that will be used as the path for the definition and extended definitions. So here's some examples of my tiles: !-- Main -- definition name=com.acme.web.search.tiles.main path=/search/setupTiles.do put name=content value=OVERRIDE THIS / put name=title value=Search available domains / /definition !-- Template definition for site layout 1 -- definition name=com.acme.web.search.tiles.main.acme path=/front/tiles/tiles_front_main.jsp put name=content value=OVERRIDE THIS / put name=title value=Search layout 1 / /definition !-- Template definition for yr -- definition name=com.acme.web.search.tiles.main.yr path=/search/tiles/tiles_front_yrse.jsp put name=content value=OVERRIDE THIS / put name=title value=Search layout 2 / /definition definition name=com.acme.web.search.tiles.search extends=com.acme.web.search.tiles.main put name=content value=/search/pages/search.jsp / /definition And struts-config action path=/setupTiles type=com.acme.web.search.actions.SetupTilesAction forward name=acme path=com.nictrade.web.search.tiles.main.acme / forward name=yr path=com.nictrade.web.search.tiles.main.yr / /action And com.acme.web.search.actions.SetupTilesAction public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) { // Do some conditional logic here to determine layout return mapping.findForward( yr ); } Is this the information you wanted?, if so I hope it helps. /Andreas Benedict, Paul C wrote: Andreas, This is a wild solution. I don't understand page 15 and I've used Tiles before, but not in this way. Could you explain it? -Original Message- From: Andreas Toom [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 10, 2005 1:58 AM To: Struts Users Mailing List Subject: Re: Multiple tiles layouts for single application Hello again, great pdf there, solved my problem nice and easy. Instead of a jsp in the path attribute of a definition I used a struts action which forwards to the right template, should work really nice. Thank you very much for the help! /Andreas Allistair Crossley wrote: http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf page 15 may help you Cheers. -Original Message- From: Andreas Toom [mailto:[EMAIL PROTECTED] Sent: 09 May 2005 15:33 To: Struts Users Mailing List Subject: Re: Multiple tiles layouts for single application Yes, but a tile definition is just a.. tile definition. All my definitions extends a base tile: definition name=com.acme.web.search.tiles.main path=/front/tiles/tiles_front_main.jsp put name=content value=OVERRIDE THIS / put name=title value=Search here / /definition definition name=com.acme.web.search.tiles.search extends=com.acme.web.search.tiles.main put name=content value=/search/pages/search.jsp / /definition And my forwards are: forward name=success path=com.acme.web.search.tiles.search / forward name=failure path=com.acme.web.search.tiles.error / So now, if a request has been made to http://mysite/?layout=layout1 or whatever it seems like a nice solution not have to change anything in my action configuration and instead have a filter/extension of a controller indicating which tile definitions to use, is this possible? or do I have to add a action-mapping/forward for each new site I want enable this search functionality? As I sad before, the main problem as I see it is the input parameter in form validation, I guess I could solve it with some action in the input parameter instead, but all those solutions feel ugly and leaves me with much work if anything is about to change.. Any other ideas? :) /Andreas Allistair Crossley wrote: Your requests should be routing through a Struts Controller via an ActionMapping, and therefore your Action can examine the request and return the appropriate view which will be a forward to the tile definition of your choice. Cheers, Allistair. -Original Message- From: Andreas Toom [mailto:[EMAIL PROTECTED] Sent: 09 May 2005 15:05 To: user@struts.apache.org Subject: Multiple tiles layouts for single application Hello, is there a way to switch tiles layout in an applaction depending on let's say request url. I have a struts-based application with a single purpose and I want to share this functionality with other php-based sites that my company have. So if a request comes in to the site I want different layouts, each matching the calling site, for example: http://myhost/myapp/ - Original layout http://myhost/myapp/site1 - Site1 layout http://myhost/myapp/site2 - Site2 layout
(OT) Acegi Struts
Hello all, Sorry for partially off-topic question, but I am looking For some feedback.. Is anyone using (or has used, or plan to use) acegi security system(http://acegisecurity.sourceforge.net/) with Struts? Any feedback? Any recommendations for other security 'systems' to use with struts and spring? Thanx in advance and regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (OT) Acegi Struts
Hello, Have you look at CAS? www.yale.edu/tp/auth/cas10.html Rodolfo ___ Marco Mistroni [EMAIL PROTECTED] 11/05/2005 11:26 Por favor, responda a Struts Users Mailing List Para: 'Struts Users Mailing List' user@struts.apache.org cc: (cco: Rodolfo García Esteban/CYII) Asunto: (OT) Acegi Struts Hello all, Sorry for partially off-topic question, but I am looking For some feedback.. Is anyone using (or has used, or plan to use) acegi security system(http://acegisecurity.sourceforge.net/) with Struts? Any feedback? Any recommendations for other security 'systems' to use with struts and spring? Thanx in advance and regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: StrutsCatalogInputOutputSeparation
On 5/10/05, Benedict, Paul C [EMAIL PROTECTED] wrote: I have read Michael Jouravlev's article: http://wiki.apache.org/struts/StrutsCatalogInputOutputSeparation I can't find any blog or comment box on the page, so I'll write here. I would like people to freely respond to my comments. Apparently, with Moin Moin you need to add any comments directly to the page. We should probably get in the habit of adding a == Comments == section to the foot of each page, since we do want the wiki to be a shared resource. Of course, because it is a shared resource, it's quite possible that some wiki articles will contradict each other in some ways. But, that's OK. Reasonable minds can disagree. :) -Ted. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: (OT) Acegi Struts
On May 11, 2005, at 3:26 AM, Marco Mistroni wrote: Hello all, Sorry for partially off-topic question, but I am looking For some feedback.. Is anyone using (or has used, or plan to use) acegi security system(http://acegisecurity.sourceforge.net/) with Struts? I'm using Acegi as part of AppFuse - of which Struts is the default web framework. Here is a howto for converting from CMA to Acegi Security. http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseAuthentication I really like Acegi b/c it has many additional features that other security systems don't have. For example, the ability to get the user's information at any layer in your application (via a ThreadLocal) and the ability to easily control method invocations based on roles. It's ACL feature is pretty nice too. Matt Any feedback? Any recommendations for other security 'systems' to use with struts and spring? Thanx in advance and regards marco - 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: (OT) Acegi Struts
Hi Have a look at another SF project: SecurityFilter Hermod -Original Message- From: Rodolfo García Esteban/CYII [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 11:34 AM To: Struts Users Mailing List Subject: Re: (OT) Acegi Struts Hello, Have you look at CAS? www.yale.edu/tp/auth/cas10.html Rodolfo ___ Marco Mistroni [EMAIL PROTECTED] 11/05/2005 11:26 Por favor, responda a Struts Users Mailing List Para: 'Struts Users Mailing List' user@struts.apache.org cc: (cco: Rodolfo García Esteban/CYII) Asunto: (OT) Acegi Struts Hello all, Sorry for partially off-topic question, but I am looking For some feedback.. Is anyone using (or has used, or plan to use) acegi security system(http://acegisecurity.sourceforge.net/) with Struts? Any feedback? Any recommendations for other security 'systems' to use with struts and spring? Thanx in advance and regards marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT JSTL c:out
I want to only print a portion of a string with JSTL c:out tag So if my string = foobar, I want to know how to print out xxxbar Thanks -B - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
R: OT JSTL c:out
Hi, You can use the fn:substring function (see some documentation, for example JSTL1.1 specification, for the attributes). In order to use it, you have to declare the directive taglib i.e. %@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn % at the begin of jsp. BR /Amleto -Messaggio originale- Da: Brian McGovern [mailto:[EMAIL PROTECTED] Inviato: mercoledì 11 maggio 2005 15.29 A: Struts Users Mailing List Oggetto: OT JSTL c:out I want to only print a portion of a string with JSTL c:out tag So if my string = foobar, I want to know how to print out xxxbar Thanks -B - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.8 - Release Date: 10/05/2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Saving context in web application with exception-driven authentication
Hi! I'm looking for a suitable solution for the following problem which concerns authentication. In my application the logon process is triggered by an exception which is thrown by the call of an API function. The important moment is that my web application cannot know whether the user has the rights to call this function before it is actually called. The function throws a specific exception in case if the user has insufficient rights. Upon receiving this exception the application must display the logon page. After logging in, the user has to be automatically redirected to the input page of the Action where the API function was initiated. The form of the input page must contain the values which the user had entered before the API function failed. The question is: how do I do it? I am already using the Struts ExceptionHandler to trigger the login form upon catching the specific exception. I suspect that I'll have to store the context (the ActionForm of the input page) in the session scope - but I don't know how to make the substitution of the input JSP form with the saved context (how to fill the page form fields with the values entered by the user before he had to log in). Yaroslav Novytskyy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
unable to access properties from formbean in included jsp
I am creating a new bean containg struts formbean in jsp .I put this new bean in request scope. I want to include another jsp in this jsp. In another jsp I want to access the properties from the new bean . Any property I try to write or define I get error message no getter and setter method found for the property . But If I do the same from actual jsp not the included one I get no error it works fine there. bean:struts id=testbean formBean=welcomeForm/ request:setAttribute name=advSearchFormbean%=testbean% /request:setAttribute jsp:include page=/jsp/reviewtrans/test.jsp/ -end of actual jsp- In test.jsp bean:write name=advSearchFormbean property=welcomePageMap scope=request/ I get this error No getter method for property welcomePageMap of bean advSearchFormbean Can somebody help me with this. thanks regards Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: StrutsCatalogInputOutputSeparation
Michael, I read your article again two more times, and I have to say I really do like it. It's an ingenious solution; so I am warming up to it in some areas. Regardless, this email thread will certainly help everyone think through the problem :) Here are some further reflections: 1) I wrote: do not like putting any output data in the form unless it started as input. This needs to be framed within the context of normal Struts development. If I am going to return data that will be returned in an HTML form, the appropriate form properties are populated. My sentence is directed towards non-HTML display, what I term output data, because it has no further purpose besides display purposes (i.e.: output). 2) You wrote: Ted Husted does not consider a single forward from one action to another to be chaining ;) Agreed. He explicitly states this when referencing Tiles or a JSP page -- a view needs to be returned. However, my point is virtually moot because the conclusion of your article is not to forward but to redirect. 3) The redirection for errors requires Struts 1.2.7 or later .. or you will lose the error messages. :-) Because redirection creates multiple requests, it does imply that all forms need to become session based. How necessary is this for an entire web application? My general rule is to keep forms in request-scope, because it allows multiple views of a form to be accessed during a session, plus clean-up is automatic. I know your methodology is to associate a random identifier to a session form, but are you concerned that the session can be filled with tons of objects? A malicious user, assuming he knew your methodology, could just F5 the web page and force unlimited memory allocation via the session. Thanks, Paul -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 10, 2005 4:51 PM To: Struts Users Mailing List Subject: Re: StrutsCatalogInputOutputSeparation On 5/10/05, Benedict, Paul C [EMAIL PROTECTED] wrote: I have read Michael Jouravlev's article: http://wiki.apache.org/struts/StrutsCatalogInputOutputSeparation I can't find any blog or comment box on the page, so I'll write here. I would like people to freely respond to my comments. I disagree with the two-actions methodology to solve the separation of input and output data. If Actions are a web-interface into your business logic, there is no need to go into another action to do more processing; I believe the chains approach in Struts 1.3 solves this problem by keeping chains of logic below the Web/Struts layer. Perhaps, the wiki page does not have enough arguments and explanation, why I believe this is the good way do Struts UI actions. If you can spare 20 minutes, maybe you would like to read this arcticle: http://www.theserverside.com/articles/article.tss?l=RedirectAfterPost And them check these two applications, they do exactly the same thing, but this one http://www.superinterface.com/fwapp/viewList.do uses in-server forward, and this one http://www.superinterface.com/rdapp/viewList.do uses redirect via browser (sorry, when I was updating the redirecting app, I lost original pages with explanatory text, but the functionality is the same). Try them, try to refresh pages, to go back and forward, to delete item from the list and refresh the list, etc. You will see how robust the redirecting app is comparing to forwarding one. This technique is known as ActionChaining and, as I agree, it seems to be frowned upon: http://wiki.apache.org/struts/ActionChaining Do you think that this technique is bad only because of someone else's opinion? ;) Even King Arthur, Einstein and Von Braun made mistakes. Plese, think it over again, and see i/o separation has its benefits. Also, Ted Husted does not consider a single forward from one action to another to be chaining ;) I personally do not like putting any output data in the form unless it started as input. I envision ActionForms to be tightly linked to HTML forms. I see, this is what I call a DialogAction. I have this too, this is slightly different type of separation, but it is there, too. First, i submit input data to the action using POST, then I redirect to the same action, and load the page using GET. Action decides, is it input or output by request type. Form has session scope. Simple and it works. To clean form I use a special init request parameter. Conceptually speaking, since HTML forms can only contain input-like elements, so should only ActionForm objects too. I put my output data exclusively in request or session attributes as necessary, but never the form; I believe this complicates and misuses the conception of a form. I guess, you use approach like this: http://wiki.apache.org/struts-data/attachments/StrutsCatalogInputOutputSepar ation/attachments/actioncombo03.gif I am totally not against it, I use it myself too. But here you disagree with yourself. You just said, that you do not like putting any output data in
LookupDispatchAction - missing resource in key method map
I've banged my head on this problem for at least 4-5 hours, and I'm at my wits end. I've already reviewed several possible solutions, but it appears that I have everything in order for using the LookupDispatchAction class. Here's the message that I receive: --- 10:17:29,172 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception javax.servlet.ServletException: Action[/postRespondentFormAction] missing resource 'addMemory' in key method map --- Here is the excerpt from Application.resources: --- button.respondent.add.memory = continue to protective order --- Here is the excerpt from struts-config.xml: --- action path=/postRespondentFormAction type=com.appriss.vpo.web.struts.protectiveOrder.RespondentFormAction name=respondentForm scope=request validate=true parameter=methodToCall input=/tiles2-new-respondent.do forward name=continue path=/home.do / /action --- My RespondentFormAction class extends the LookupDispatchAction class and has the addMemory method: --- public ActionForward addMemory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } --- I also populate the map as such: --- protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.pp.add, add); map.put(button.respondent.add.memory, addMemory); return map; } --- Funny thing is is that I have other LookupDispatchActions working correctly in other places. I don't know what I'm overlooking and doing differently with this one. Any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problems with Form Action Using Struts-Faces Integration Library
Am I posting to the wrong list for Struts-Faces problems? Kevin Hinners -Original Message- From: Kevin Hinners [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 10, 2005 3:11 PM To: user@struts.apache.org Subject: Problems with Form Action Using Struts-Faces Integration Library I am trying to rewrite a Struts-based web application to use JavaServer Faces and Struts-Faces Integration Library. I am trying to rewrite the web pages from struts tags to JSF and Struts-Faces tags. I want to reuse my existing Action and ActionForm classes and Struts for the controller. The problem I am having is the way page view.jsp renders s:form action=/editAction to the browser. When I view source on the rendered web page, the form shows the action as form action=/pager/view.do, not form action=/pager/editAction.do. When I try to submit the page, I get an error Invalid path /view.do. What am I doing wrong here? I tried looking at the example web apps that come with the Struts-Faces Integration Library, but I am confused by the need for backing beans. Are these required? Kevin Hinners - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html-el:img question
Hey all I've got the followiong directory structure for my web-app C:\Builds\riskGrid\WebRoot\jsp (all JSP's are here) C:\Builds\riskGrid\WebRoot\jsp\images (all images) This is the image code (in a JSP in the jsp directory) that results in the image not being found. What am I missing?? I cant have an absolute URL for obvious reasons. (note everything else is working, the link, the submit, etc.) html-el:img src=../jsp/images/portGraph.gif onclick=set('portfolioGraph');javascript:setPortName('${ refPortfolio.refPortfolioDesc}');document.forms[0].submit();/ -- -Dave [EMAIL PROTECTED]
Re: html-el:img question
Interesting twist, when I add in html:base/ it gets translated into this: base href=http://localhost:8080/myApp/jsp/layouts/siteLayout.jsp; So, does that mean the base location is the layouts dir? Obviously I'm using Tiles in this app. Thoughts? On 5/11/05, David Johnson [EMAIL PROTECTED] wrote: Hey all I've got the followiong directory structure for my web-app C:\Builds\riskGrid\WebRoot\jsp (all JSP's are here) C:\Builds\riskGrid\WebRoot\jsp\images (all images) This is the image code (in a JSP in the jsp directory) that results in the image not being found. What am I missing?? I cant have an absolute URL for obvious reasons. (note everything else is working, the link, the submit, etc.) html-el:img src=../jsp/images/portGraph.gif onclick=set('portfolioGraph');javascript:setPortName('${ refPortfolio.refPortfolioDesc}');document.forms[0].submit();/ -- -Dave [EMAIL PROTECTED] -- -Dave [EMAIL PROTECTED]
user hitting back-button and sending POSTDATA
I am having trouble getting information, or a workaround for the following problem. A user fills out a simple textfield form. I update the database with the value and show a new jsp page. Then the user hits the back-button, and even though the browser gives an alert (this will POSTDATA that is expired as cache) yes or no? And they say yes, I enter another record into my database. Causing problems. I have my nocache set to true in my struts-config.xml. Any other ideas, solutions to this problem? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
StrutsCatalogInputOutputSeparation continued / PRG
Michael, I want to continue this discussion because I think it has merit. I've used the PRG pattern for over a year since I first came across your article on TheServerSide.com. It works well in most cases, but I don't use it 100% of the time because of certain limitations. It just happened that your positing to the Struts Wiki brought up this subject again, and, to me, and it's worth revisiting. I only implement PRG on hard operations (such as saving or deleting, as opposed to viewing) that succeed. Redirecting after a successful operation that concretely alters data is critical to prevent the POSTDATA situation. However, I do *not* implement PRG on loading an item for viewing/editing or a failed save/delete. I deviate from your recommendation because (1) I want to keep automatic Struts validation and (2) I do not want to put errors and messages in the session. Can you give me some strong arguments to why I should yield from my preference? I want to see the benefit. As a general rule, my forms are request scope because I do not want to tie a user's view to their session. For instance, I've seen clients who CTRL+N in Internet Explorer and surf around a web application in two separate views -- what makes this special is that IE allows different views (windows) to be under the same session!! By altering the app in one window, the other window could be adversely affected on its next request. So, for instance, could your recommendation allow editing of two simultaneous WhateverForm items within the same session? This is an important requirement that I cannot lose. Thanks, Paul -- Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaValidatorForm not validating ?
I'm trying to set up a DynaValidatorForm and I can't seem to get it to work. As you can see, the log leads you to believe it *did* validate and the validation passed (?) Log: 2005-05-11 12:23:22,004 DEBUG [RequestProcessor] Storing ActionForm bean instance in scope 'request' under attribute key 'loginForm' 2005-05-11 12:23:22,004 DEBUG [RequestProcessor] Populating bean properties from this request 2005-05-11 12:23:22,004 DEBUG [BeanUtils] BeanUtils.populate(DynaActionForm[dynaClass=loginForm,password=,emailAddress=], {password=[Ljava.lang.String;@a4edc4, emailAddress=[Ljava.lang.String;@1f5eb7f}) 2005-05-11 12:23:22,004 DEBUG [BeanUtils] setProperty(DynaActionForm[dynaClass=loginForm,password=,emailAddress=], password, [badValue2]) 2005-05-11 12:23:22,004 DEBUG [ConvertUtils] Convert string 'badValue2' to class 'java.lang.String' 2005-05-11 12:23:22,004 DEBUG [ConvertUtils] Using converter [EMAIL PROTECTED] 2005-05-11 12:23:22,014 DEBUG [BeanUtils] setProperty(DynaActionForm[dynaClass=loginForm,password=badValue2,emailAddress=], emailAddress, [badValue1]) 2005-05-11 12:23:22,014 DEBUG [ConvertUtils] Convert string 'badValue1' to class 'java.lang.String' 2005-05-11 12:23:22,014 DEBUG [ConvertUtils] Using converter [EMAIL PROTECTED] 2005-05-11 12:23:22,024 DEBUG [RequestProcessor] Validating input form properties 2005-05-11 12:23:22,034 DEBUG [RequestProcessor] No errors detected, accepting input 2005-05-11 12:23:22,044 DEBUG [RequestProcessor] Looking for Action instance for class org.jsurveys.web.struts.LoginAction Been staring too long, can anyone see what is happening, based upon my snippets below? Thanks in advance!! Mike * struts-config.xml*** form-bean name=loginForm type=org.apache.struts.validator.DynaValidatorForm form-property name=emailAddress type=java.lang.String/ form-property name=password type=java.lang.String/ /form-bean other configurations... action path=/login type=org.jsurveys.web.struts.LoginAction name=loginForm input=login.page scope=request forward name=success path=welcome.page/ forward name=failure path=login.page/ /action ***validator.xml formset form name=loginForm field property=emailAddress depends=required,email arg0 key=prompt.userEmailAddress/ /field field property=password depends=required, minlength,maxlength arg0 key=prompt.userPassword/ arg1 key=${var:minlength} name=minlength resource=false/ arg2 key=${var:maxlength} name=maxlength resource=false/ var var-namemaxlength/var-name var-value12/var-value /var var var-nameminlength/var-name var-value6/var-value /var /field /form /formset ***login.jsp uses form... html:form action=/login.do method=POST ..form stuff... ***loginAction.java processes ..Action stuff...no validation logic... public class LoginAction extends ActionSupport { **NOTE** ActionSupport is from the Spring framework, it extends Action and adds functionality to access a Spring ApplicationContext. * - Yahoo! Mail Stay connected, organized, and protected. Take the tour
Re: html-el:img question
Any thoughts on this? I tried html-el:img src=../../jsp/images/portGraph.gif but that is an illegal argument :( On 5/11/05, David Johnson [EMAIL PROTECTED] wrote: Interesting twist, when I add in html:base/ it gets translated into this: base href=http://localhost:8080/myApp/jsp/layouts/siteLayout.jsp;http://localhost:8080/myApp/jsp/layouts/siteLayout.jsp%22 So, does that mean the base location is the layouts dir? Obviously I'm using Tiles in this app. Thoughts? On 5/11/05, David Johnson [EMAIL PROTECTED] wrote: Hey all I've got the followiong directory structure for my web-app C:\Builds\riskGrid\WebRoot\jsp (all JSP's are here) C:\Builds\riskGrid\WebRoot\jsp\images (all images) This is the image code (in a JSP in the jsp directory) that results in the image not being found. What am I missing?? I cant have an absolute URL for obvious reasons. (note everything else is working, the link, the submit, etc.) html-el:img src=../jsp/images/portGraph.gif onclick=set('portfolioGraph');javascript:setPortName('${ refPortfolio.refPortfolioDesc}');document.forms[0].submit();/ -- -Dave [EMAIL PROTECTED] -- -Dave [EMAIL PROTECTED] -- -Dave [EMAIL PROTECTED]
Re: html-el:img question
From: David Johnson [EMAIL PROTECTED] Any thoughts on this? I tried html-el:img src=../../jsp/images/portGraph.gif but that is an illegal argument :( What is the URL in the browser window when it's trying to load the image? Images are requested separately by the browser after the page is loaded. The URL for the image needs to be relative to the page the browser thinks it loaded, not the location of the JSP files. BTW, it looks like a plain old HTML img src=... tag would work fine here, why suffer the overhead of a taglib when there is no dynamic content? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html-el:img question
The full img tag includes some el tags which werent coming out properly with a normal img tag :( I tried that first :) the URL when this page is up is : http://localhost:8080/myApp/portfolio.action but the base href is: base href=http://localhost:8080/myApp/jsp/layouts/siteLayout.jsp; html-el:img src=../jsp/images/portGraph .gif onclick=set('portfolioGraph');javascript:setPortName('${ refPortfolio.refPortfolioDesc}');document.forms[0].submit();/ how can I embed the above el stuff in a notmal img tag, and also within a JS call? On 5/11/05, Wendy Smoak [EMAIL PROTECTED] wrote: From: David Johnson [EMAIL PROTECTED] Any thoughts on this? I tried html-el:img src=../../jsp/images/portGraph.gif but that is an illegal argument :( What is the URL in the browser window when it's trying to load the image? Images are requested separately by the browser after the page is loaded. The URL for the image needs to be relative to the page the browser thinks it loaded, not the location of the JSP files. BTW, it looks like a plain old HTML img src=... tag would work fine here, why suffer the overhead of a taglib when there is no dynamic content? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -Dave [EMAIL PROTECTED]
Re: Input Page Enhancement?
Actually, you can make it redirect, but this affects the whole application, since you need to make change in controller element: controller inputForward=true/ Then you will need to refer a forward element in your input property: action ... input = itemError ... forward name=itemError path=/displayError.do redirect=true/ /action Because this involves a regular forward element anyway, I think that input in its current state does not make much sense. We can simply have a designated forward for input errors, with predefened mapping name, like ERROR_INPUT: action ... forward name=ERROR_INPUT path=/displayError.do redirect=true/ /action This will also allow to have several error handlers, with names starting on ERROR_ or something. Just a thought. Michael. On 5/11/05, Benedict, Paul C [EMAIL PROTECTED] wrote: From all this discussion, something occurred to me: I think someone should submit an enhancement for Struts 1.2.8/1.3, so that we can define the input page as an action forward/redirect: action path=/test type=com.company.someClass forward name=input path=/letsGoHere.do redirect=true / forward name=success path=page.success / /action After talking with Michael, this solution would solve one of the input/output problems that need to be addressed: greater control over the error page. By having the input be a reserved forward, developers could also say it is a redirect. Can someone investigate the impact of modifying the getInputForward method? Thanks, Paul - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: user hitting back-button and sending POSTDATA
On 5/11/05, Scott Purcell [EMAIL PROTECTED] wrote: I am having trouble getting information, or a workaround for the following problem. A user fills out a simple textfield form. I update the database with the value and show a new jsp page. Then the user hits the back-button, and even though the browser gives an alert (this will POSTDATA that is expired as cache) yes or no? And they say yes, I enter another record into my database. Causing problems. I have my nocache set to true in my struts-config.xml. Any other ideas, solutions to this problem? Thanks, Scott If you are looking how to detect double submit, then use tokens. If you want to get rid from double submits and from POSTDATA dialog, use redirection. To use redirection, submit your data with POST, process it, then redirect to the result page. User will be able to reload it without causing a resubmit. Of course, you would need to save the data and messages somewhere between requests, either in the session or you can stuff then into request as a bunch of query parameters. You just need to decide what is more important for you: to solve the culprit of double submit, or to detect and handle it. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html-el:img question
From: David Johnson [EMAIL PROTECTED] the URL when this page is up is : http://localhost:8080/myApp/portfolio.action but the base href is: base href=http://localhost:8080/myApp/jsp/layouts/siteLayout.jsp; FWIW, I never use base. Or at least I would set it to something reasonable like the index page of the site. Given that URL, without the base tag, it seems to me the proper URL would just be jsp/images/portGraph.gif. html-el:img src=../jsp/images/portGraph .gif onclick=set('portfolioGraph');javascript:setPortName('${ refPortfolio.refPortfolioDesc}');document.forms[0].submit();/ Is this copied and pasted? You have a space in the image filename... how can I embed the above el stuff in a notmal img tag, and also within a JS call? You can use c:out to get the dynamic part into whatever HTML you want. (I'd also move that mess of JavaScript into a function and pass it whatever argument it needs.) But... it shouldn't be relevant-- whether you use plain old HTML or let Struts generate for you, it's still just HTML by the time it gets to the browser, and the browser should be able to load the image. Check that possible typo, and let us know how it goes! -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: user hitting back-button and sending POSTDATA
At 10:35 AM -0700 5/11/05, Michael Jouravlev wrote: On 5/11/05, Scott Purcell [EMAIL PROTECTED] wrote: I am having trouble getting information, or a workaround for the following problem. A user fills out a simple textfield form. I update the database with the value and show a new jsp page. Then the user hits the back-button, and even though the browser gives an alert (this will POSTDATA that is expired as cache) yes or no? And they say yes, I enter another record into my database. Causing problems. I have my nocache set to true in my struts-config.xml. Any other ideas, solutions to this problem? Thanks, Scott If you are looking how to detect double submit, then use tokens. If you want to get rid from double submits and from POSTDATA dialog, use redirection. To use redirection, submit your data with POST, process it, then redirect to the result page. User will be able to reload it without causing a resubmit. Of course, you would need to save the data and messages somewhere between requests, either in the session or you can stuff then into request as a bunch of query parameters. Michael: In Scott's case, the user is hitting the back button, not reloading the result page. I think that even using your redirect strategy, there is no protection against the user navigating back and resubmitting a form, isn't that right? Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Way of reading this mailing list as a heirachy
See intermixed -Original Message- From: Mark Benussi [mailto:[EMAIL PROTECTED] ==== My award of the week goes to Adam for this piece of information. I was just downloading some open source e-mail client but am relieved I can do this option. -Original Message- From: Adam Hardy [mailto:[EMAIL PROTECTED] ==== I use Outlook and was wondering if there was a way of reading all these messages as a hierarchy. I sometimes miss messages on a thread I was interested in. I always thought outlook couldn't do message threads, but it can. I don't remember the option on whichever menu, but it's easy to find. Probably the View menu. It sets up the threads just like a newsgroup. If you really can't find it, perhaps your Outlook is an old version. Try in Outlook, in at least version 2000. Menu Bar - View - Current View - By Conversation Topic If you want to try something weird assuming you have a massive monitor and good eyes Menu Bar - View - Current View - Message Timeline Adam PS you should familiarise yourself with security issues in outlook as well, for instance, you should disable javascript and images in your incoming emails. ==== -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom Tel: +44-(0)207-883-4497 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
nested:iterate and nested:hidden question
Hi, I have a nested object hierarch as follows: public Class Discrepancy { String[] discrepancyIds; } public Class CashException { Collection discrepancies; // collection of Discrepancy objects } In my JSP, I tried the following: nested:iterate property=discrepancies nested:iterate id=discrepancyId property=discrepancyIds nested:hidden property=discrepancyId / !-- ??? -- /nested:iterate /nested:iterate How would I generate hidden tags for all of the nested Id fields? I also tried: Thanks in advance, -Ben - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: user hitting back-button and sending POSTDATA
On 5/11/05, Joe Germuska [EMAIL PROTECTED] wrote: At 10:35 AM -0700 5/11/05, Michael Jouravlev wrote: On 5/11/05, Scott Purcell [EMAIL PROTECTED] wrote: I am having trouble getting information, or a workaround for the following problem. A user fills out a simple textfield form. I update the database with the value and show a new jsp page. Then the user hits the back-button, and even though the browser gives an alert (this will POSTDATA that is expired as cache) yes or no? And they say yes, I enter another record into my database. Causing problems. I have my nocache set to true in my struts-config.xml. Any other ideas, solutions to this problem? Thanks, Scott If you are looking how to detect double submit, then use tokens. If you want to get rid from double submits and from POSTDATA dialog, use redirection. To use redirection, submit your data with POST, process it, then redirect to the result page. User will be able to reload it without causing a resubmit. Of course, you would need to save the data and messages somewhere between requests, either in the session or you can stuff then into request as a bunch of query parameters. Michael: In Scott's case, the user is hitting the back button, not reloading the result page. I think that even using your redirect strategy, there is no protection against the user navigating back and resubmitting a form, isn't that right? Joe Oops, I missed that. Too much fighting for today :) Actually, I have a solution that I use, which does not allows explicit resubmits too, but it involves quite a few changes to Model/View part, which he most likely will not want to implement. On the other hand, he did not clarify, that user resubmitted the form explicitly. What might have happened, is that the form itself was a result of POST, so when he goes back, the form is reloaded, hence the dialog. The user saw a warning dialog, which, if I remember correctly, does not appear if the form is resubmitted explicitly. So, most likely he clicked the Forward button after clicking Back button. This is the same as Reload, if page is marked as non-cachable. In this case redirect would help. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to download file (example)
Hello, Do you want to use the Struts DownloadAction? If so, have a look here: http://wiki.apache.org/struts/StrutsFileDownload Even if you don't want to use it, you may find the example helpful, along with the source for DownloadAction, to help you along. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, May 11, 2005 2:30 pm, Grzegorz Stasica said: hi, I'm looking for links/examples how to download file in struts action. In action I have OutputStream but what header should I send and the most important how the stram should be send to browser - 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 download file (example)
True... I would however be very willing to bet you can lift the DownloadAction class from 1.2.6 and drop it in 1.2.4 without any problem... As a matter of fact, although I'm not 100% certain, I think the sample app I wrote that you can grab off the Wiki is in fact using 1.2.4... heck, there's a chance it's using 1.1! :) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, May 11, 2005 3:30 pm, Grzegorz Stasica said: Frank W. Zammetti wrote: Hello, Do you want to use the Struts DownloadAction? If so, have a look here: http://wiki.apache.org/struts/StrutsFileDownload Even if you don't want to use it, you may find the example helpful, along with the source for DownloadAction, to help you along. Unfortunatelly I am running struts 1.2.4. DownloadActioni will be available in 1.2.6 version which at this moment is in beta phase - 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 download file (example)
This is a little example : response.setHeader(Content-Disposition, attachment; filename=\ + part.getFileName() + \); response.setContentType(part.getContentType()); InputStream instream = part.getInputStream(); ServletOutputStream outstream = response.getOutputStream(); int b = 0; while (b != -1) { b = instream.read(); outstream.write(b); } instream.close(); outstream.close(); WHERE part.getFileName() sustitute by the Filename of the File, part.getContentType() sustitute the ContentType of the File part.getInputStream(); sustitute the Stream Data of the File. That's all! - Original Message - From: Grzegorz Stasica [EMAIL PROTECTED] To: user@struts.apache.org Sent: Wednesday, May 11, 2005 9:30 PM Subject: Re: how to download file (example) Frank W. Zammetti wrote: Hello, Do you want to use the Struts DownloadAction? If so, have a look here: http://wiki.apache.org/struts/StrutsFileDownload Even if you don't want to use it, you may find the example helpful, along with the source for DownloadAction, to help you along. Unfortunatelly I am running struts 1.2.4. DownloadActioni will be available in 1.2.6 version which at this moment is in beta phase - 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: Is struts more performant than JSF
On 11/05/05 00:15nbsp;Matt Raible wrote: You could hammer on AppFuse and Equinox - they both have Struts and JSF versions. http://demo.appfuse.org/appfuse (Struts 1.2.4) http://demo.appfuse.org/appfuse-jsf (MyFaces 1.0.7) http://demo.raibledesigns.com/equinox-struts (same versions as above) http://demo.raibledesigns.com/equinox-jsf I haven't seen any performance differences in my experience - but I also haven't stress tested either of these applications under super-heavy load. I also haven't had any out-of-memory issues when using them in production - so they should make good test cases. It would also be very interesting to read comparative analysis of the two apps from the development point of view - speed of development, complexity, extensibility, manageability etc. Adam -- struts 1.2 + tomcat 5.0.19 + java 1.4.2 Linux 2.4.20 Debian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problems with ActionError
Hi I'm trying to use the ActionErrors clases. I'm doing validation on the Action class like this: if (user == null) { errors.add (username, new ActionError (errors.fieldisrequired, username)); } saveErrors (request, errors); Ths resource file is configured correctly. I can do a getMessage inside the action class and it works. In my JSP I show the error like this: html:errors property=username/ The error is not generated. The scope is request and the forward has redirect = false. Any ideas?
servlet mapping , possible OT
Hello All, I have a struts app which is having problems with its servlet mapping. this problem appeared seemingly on its own, unrelated to any change to the configuration. surely thats unlikely, but i'm the only admin on the box and i don't remember changing anything. the app is running on tomcat, behind apache2, through mod_jk. the problem: this mapping works: /apps/directoryindex this mapping doesn't: /apps/admin/login more to the point anything with one directory level goes to tomcat, and anything that has more than one directory level doesn't. my web.xml mapping: servlet-mapping servlet-nameapps/servlet-name url-pattern/apps/*/url-pattern /servlet-mapping and apache vhost: Location /apps/* JkUriSet worker ajp13:localhost:8009 /Location so /apps/whatever which is not a valid struts action, gives a tomcat Invalid path /whatever was requested but /apps/what/ever gives an apache 404 page. Ring any bells for anyone? dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Feature wanted: autocomplete attribute for html:text/form tag s
On Tue, May 10, 2005 at 05:12:40PM +0100, Niall Pemberton wrote: Since Struts 1.2.5 the html tags have had some re-factoring that makes it easier to create your own custom version. All you need to do is extend the TextTag, add appropriate getter/setter methods for a new autocomplete property and override the prepareOtherAttributes() method to output your additional attribute: protected void prepareOtherAttributes(StringBuffer handlers) { prepareAttribute(handlers, autocomplete, getAutocomplete()); } You will also either need to modify the struts tld to point to your custom tag and add your additional attribute - or create your own tld for the custom tag. Bug 1598 talked about adding the kind of facility you mention, but no-ones done anything about it and there are other bug tickets which are related: http://issues.apache.org/bugzilla/show_bug.cgi?id=1598 http://issues.apache.org/bugzilla/show_bug.cgi?id=29379 http://issues.apache.org/bugzilla/show_bug.cgi?id=32215 Niall Thanks for info.. t. -- _i__'simplicity_is_the_key'__tomasz_nazar _ii'i_am_concern_oriented'__iiuwr _iii__'patsystem.sf.net'___linux_user _Heaven__Fellows,_PPP__prevayler - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested:iterate and nested:hidden question
Liu, Benson wrote the following on 5/11/2005 2:21 PM: public Class Discrepancy { String[] discrepancyIds; } public Class CashException { Collection discrepancies; // collection of Discrepancy objects } In my JSP, I tried the following: nested:iterate property=discrepancies nested:iterate id=discrepancyId property=discrepancyIds nested:hidden property=discrepancyId / !-- ??? -- /nested:iterate /nested:iterate How would I generate hidden tags for all of the nested Id fields? I think the following should do what you want... (if not using JSP2.0 use the appropriate nested-el tag) nested:iterate property=discrepancies nested:iterate id=discrepancyId property=discrepancyIds nested:hidden property=discrepancyIds value=${discepancyId}/ /nested:iterate /nested:iterate -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:image and IE
The whole point is not to use the form, I think, Chad. By the way, all the browsers return the keys with .x and .y, even though some also return the variables without the .x and .y. On 5/9/05, Chad Rosen [EMAIL PROTECTED] wrote: Ok I'm going to reply to myself :) Adding this check solved the problem for IE.. request.getParameter(updateCart.x) != null However, I'd prefer to use the form. Is this the preferred way? form-property name=updateCart type=java.lang.String/ Will this catch both the IE and Firefox submissions? Or should I do this? form-property name=updateCart.x type=java.lang.String/ form-property name=updateCart.y type=java.lang.String/ From: Chad Rosen [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: html:image and IE Date: Mon, 09 May 2005 19:20:47 -0400 Hi all.. I have a shopping cart page with two submit buttons that we've changed to html:image tags. They look like this.. html:image property=checkout value=Check Out src=/cerebus/store/images/checkout.gif/ and html:image property=updateCart value=Update src=/cerebus/store/images/updateCart.gif/ In my action I'm checking to see if the user has pressed the updateCart image. If they did I return them back to the cart. if(request.getParameter(updateCart) != null) { //do stuff here. } So, this works in firefox/netscape but it doesn't in IE. I guess IE submits the value of the image as updateCart.x and updateCart.y (where x and y are the coordinates of the image that were pressed). What is the propper way to deal with this so that it works in both IE and Firefox. I'm defining my form beans in the struts-config as DynaValidatorActionForms so I can't do the solution in the struts user guide. Thanks, Chad - 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] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is struts more performant than JSF
On 5/10/05, Yan Hu [EMAIL PROTECTED] wrote: Hi: I have been playing with JSF lately. I really like it since it is very intuitive. But as I understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more performant than JSF ones? someone please shed some light on it... As with everything in life, there are tradeoffs. What you quoted above is an example (but only matters if you choose client side state saving; for server side the tree just sits in memory in the session instead). On the other hand, JSF does more for you that you have to do by yourself in a Struts app (such as using a form bean, and then having to do things like BeanUtils.copyProperties() in your action). I've never done any exhaustive timings, but am pretty familiar with the internal implementation of the Struts tags and the JSF RI code (haven't looked deeply at the MyFaces implementation, but the JSF RI code is not a useful predictor for the performance there): * Rendering from Struts custom tags and corresponding JSF component tags - slightly more complexity in the JSF case. (Rendering is more complex for more complex components, but that's functionality Struts doesn't have so it's not really something you can compare). * Decoding of JSF components versus Struts ActionForm plus copying - slightly less complexity in the JSF case. * Server side validation - roughly a push. * Request processing lifecycle - roughly a push. On the other hand, even if there turns out to be a non-trivial difference, it's still unlikely that your users will perceive the difference, unless CPU time on the machine running your servlet container is your most important performance bottleneck. That tends not to be the case with web applications, where database and network latencies tend to dominate. Bottom line -- I would not use runtime performance as a decision point for picking a web framework technology unless I knew I would be in a CPU constrained environment. Meeting functional requirements and supporting easy, maintainable development are more important. Craig McClanahan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:image and IE
form-property name=updateCart.x type=java.lang.String/ form-property name=updateCart.y type=java.lang.String/ From the docs: A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property=). So, you could just do: form-property name=x type=java.lang.String/ form-property name=y type=java.lang.String/ In a JSP: html:image property= value=Update src=/cerebus/store/images/updateCart.gif/ Then in your action: if (((DynaBean)form).get(x).equals(Update) Probably better to use the request parameter though, and not go through the trouble of setting up the form properties. Honestly, I don't see what the image tag really adds beyond some module support via the page attribute. HTH, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[POLL] What do you use action forms for?
Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NestedLazy Validation
Are you using the indexedListProperty in your validation.xml? field property=myProperty indexedListProperty=nestedForm depends=... /field Niall - Original Message - From: Vincent [EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 8:10 PM I am having a lot of fun using nested lazyforms as described here: http://www.niallp.pwp.blueyonder.co.uk/lazyactionform.html#section4 I've run into an issue though where I'm finding it hard to validate them, though. in the JSP I'm using nested:iterate to display a bunch of them. when I get them back in a post they look like: nestedForm[0].myProperty nestedForm[1].myProperty nestedForm[2].myProperty and so on. Unfortunately, they don't seem to be validating on the path key. I have setPathValidation(true) , so I followed previous advice and removed the leading / from the action path name in the validation.xml It does not seem to be validating the nested form properties only the overall containing form (a lazyForm). I'm guessing I'll have to make a custom validate method for my nestedLazyForm? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [POLL] What do you use action forms for?
#2 :) #1 if possible too (means, if I'm too lazy to go for number 2) -Ursprüngliche Nachricht- Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Mai 2005 00:03 An: Struts Users Mailing List Betreff: [POLL] What do you use action forms for? Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - 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: [POLL] What do you use action forms for?
#2 :) #1 if possible too (means, if I'm too lazy to go for number 2) -Ursprüngliche Nachricht- Von: Michael Jouravlev [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 12. Mai 2005 00:03 An: Struts Users Mailing List Betreff: [POLL] What do you use action forms for? Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - 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: [POLL] What do you use action forms for?
#4 So (out of interest) how are you using action forms? Jonathan Wright - Original Message - From: Matt Raible [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, May 12, 2005 10:06 AM Subject: Re: [POLL] What do you use action forms for? #1 - so I generate them from my POJOs using XDoclet. All the other frameworks I use (JSF, Spring, Tapestry and WebWork) allow me to use my POJOs directly. Matt On May 11, 2005, at 4:02 PM, Michael Jouravlev wrote: Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - 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: [POLL] What do you use action forms for?
#4 The same action form for both input and output. On 5/11/05, Michael Jouravlev [EMAIL PROTECTED] wrote: Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - 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: [POLL] What do you use action forms for?
#4 and #5 #4 So (out of interest) how are you using action forms? What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [POLL] What do you use action forms for?
A related question I've wondered about is whether to store everything a JSP page needs in the ActionForm. When I first learned Struts, that seemed like a smart idea -- everything that a page needed was stored in the one object. Obviously some of the fields would be nested objects. Now it seems to me that the only real advantage of ActionForms is that they auto-populate to and from HTML FORMs, so I only use them for that. Information that is just to be displayed on a page is stored in a scope -- request most likely. Michael Jouravlev wrote: Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager Computing and Network Services, Kansas State University - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [POLL] What do you use action forms for?
Ok Matt, so you still use them, even though you do not create them ;-) And what do you use those generated forms for? #1 means that people read input data right from the request, and stick output data in some bean of theirs, which is not an action form. On 5/11/05, Matt Raible [EMAIL PROTECTED] wrote: #1 - so I generate them from my POJOs using XDoclet. All the other frameworks I use (JSF, Spring, Tapestry and WebWork) allow me to use my POJOs directly. Matt What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction - missing resource in key method map
OkayI figured out what I was doing wrong, so I'm going to post this FYI out there just in case someone else makes the same mistake I did. In my form, I had a hidden field with the same name as the parameter (e.g. methodToCall) defined in my action. After my initialization action forwarded to the page, the hidden field was set with the parameter value I was passing in (e.g. methodToCall=addMemory). When I clicked on the add button (button.respondent.add.memory), the addMemory value was passed to the LookupDispatchAction as the key to find the method to call instead of button.respondent.add.memory. Hope this explanation makes sense. I figured it out once I downloaded the code and stepped through the code debug mode. Randy Kennedy wrote: I've banged my head on this problem for at least 4-5 hours, and I'm at my wits end. I've already reviewed several possible solutions, but it appears that I have everything in order for using the LookupDispatchAction class. Here's the message that I receive: --- 10:17:29,172 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception javax.servlet.ServletException: Action[/postRespondentFormAction] missing resource 'addMemory' in key method map --- Here is the excerpt from Application.resources: --- button.respondent.add.memory = continue to protective order --- Here is the excerpt from struts-config.xml: --- action path=/postRespondentFormAction type=com.appriss.vpo.web.struts.protectiveOrder.RespondentFormAction name=respondentForm scope=request validate=true parameter=methodToCall input=/tiles2-new-respondent.do forward name=continue path=/home.do / /action --- My RespondentFormAction class extends the LookupDispatchAction class and has the addMemory method: --- public ActionForward addMemory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } --- I also populate the map as such: --- protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.pp.add, add); map.put(button.respondent.add.memory, addMemory); return map; } --- Funny thing is is that I have other LookupDispatchActions working correctly in other places. I don't know what I'm overlooking and doing differently with this one. Any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [POLL] What do you use action forms for?
#4 Michael Jouravlev wrote: Turns out, that my way of using action forms differs from many other Struts users' habits. So, I am wondering how do you use action forms. I could not find the same poll in mailing list archives, so I am starting this one. You can answer here in the thread, or in the poll form, which I created on my site: http://www.superinterface.com/projects.htm But don't answer in both places ;) I wish wiki had a way to do polls. What is your preferred way to use action forms? #1 Prefer not to use action forms at all #2 For input data only (usually collected from HTML form) #3 For output only (to be used in JSP) #4 Same form for input and output #5 One form for input, another for output #6 Other Thanks, Michael. - 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: [POLL] What do you use action forms for?
By the way, hopefully by input and output data we understand the same information. For example, this wiki page http://wiki.apache.org/struts/StrutsMultipleActionForms treats data from a page point of view: Most pages have both input data (setup) and output data (request name/value pairs). That means, that input (setup) data is used to build the page, and output data is sent from the page. I just noticed that ;) I treat data from action's point of view. Thus, input data is sent from the browser to the action, and output data generated by action and sent to the page. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem using session var
Hi folks. I have a problem using session variables, I hope u can help me. In my jsp: bean:write name=lstTipoCambio property=strValor / In my action: if (session.getAttribute(lstTipoCambio)==null) session.setAttribute(lstTipoCambio,articuloDAO.getTipoCambio()); In my DAO: getTipoCambio returns a Collection, a set of TipoCambio objects. try { StringBuffer sbSelect = new StringBuffer(); sbSelect.append(select TCA_VALOR_F ); sbSelect.append(from SCR_TIPOCAMBIO_TCA); stmtSelect = conn.prepareStatement(sbSelect.toString()); rs = stmtSelect.executeQuery(); while (rs.next()) { TipoCambio tipocambio = new TipoCambioImpl(); tipocambio.setstrValor(rs.getString(TCA_VALOR_F)); collResultado.add(tipocambio); } } Off course TipoCambio is a bean with getters and setters method for each attribute. And the error: javax.servlet.ServletException: No getter method for property strValor of bean lstTipoCambio org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779) org.apache.jsp.pages.Articulos_002dNuevo_jsp._jspService(Articulos_002dNuevo_jsp.java:525) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:325) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261) org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:388) org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:316) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362) Please, can u know why?. If I have a TipoCambio bean with getters and setter method... THanks for ur help -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem using session var
Rafael, Your try/catch lists YOUR setter as: tipocambio.setstrValor() This suggests you make your getter tipocambio.getstrValor(). Unfortunately, bean:write capitalizes the first letter of the property so bean:write is trying to invoke 1stTipoCambio.getStrValor(), not your 1stTipoCambio.getstrValor() (Note the Str versus str in the setter which you probably used the same way in your getter) method as suggested by your example code. Regards, David -Original Message- From: Rafael Taboada [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 7:54 PM To: Struts List Subject: Problem using session var Hi folks. I have a problem using session variables, I hope u can help me. In my jsp: bean:write name=lstTipoCambio property=strValor / In my action: if (session.getAttribute(lstTipoCambio)==null) session.setAttribute(lstTipoCambio,articuloDAO.getTipoCambio()); In my DAO: getTipoCambio returns a Collection, a set of TipoCambio objects. try { StringBuffer sbSelect = new StringBuffer(); sbSelect.append(select TCA_VALOR_F ); sbSelect.append(from SCR_TIPOCAMBIO_TCA); stmtSelect = conn.prepareStatement(sbSelect.toString()); rs = stmtSelect.executeQuery(); while (rs.next()) { TipoCambio tipocambio = new TipoCambioImpl(); tipocambio.setstrValor(rs.getString(TCA_VALOR_F)); collResultado.add(tipocambio); } } Off course TipoCambio is a bean with getters and setters method for each attribute. And the error: javax.servlet.ServletException: No getter method for property strValor of bean lstTipoCambio org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContext Impl.java:846) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:779) org.apache.jsp.pages.Articulos_002dNuevo_jsp._jspService(Articulos_002dNuev o_jsp.java:525) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 325) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:245) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilte r.java:362) org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1 056) org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcess or.java:261) org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProce ssor.java:388) org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesReq uestProcessor.java:316) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231 ) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilte r.java:362) Please, can u know why?. If I have a TipoCambio bean with getters and setter method... THanks for ur help -- Rafael Taboada - 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: Problem using session var
I didn't know about capitalization of bean:write. So, how can i know in order to print some data in my jsp?. using session vars... Using JSTL?.. I don't know. -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using session var
This has nothing to do with sessions - it is just standard bean naming, and AFAIK, all jsp tags will stick to this. The methods getXxx and setXxx create a property named xxx. One more naming issue to watch out for is this one: The methods getXName and setXName create a property named XName, not xName - if the first 2 letters are uppercase, the name is taken exactly. If you cannot rename the methods, then I think you are stuck with using a scriptlet. :-( Larry On 5/11/05, Rafael Taboada [EMAIL PROTECTED] wrote: I didn't know about capitalization of bean:write. So, how can i know in order to print some data in my jsp?. using session vars... Using JSTL?.. I don't know. -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using session var
I renamed my methods but nothing happened. My new getters and setters: getStrValor() setStrValor() But it's still the same error. But I did this: logic:iterate id=lista name=lstTipoCambio bean:write name=lista property=strValor / /logic:iterate And it worked Do u know why? Because lstTipoCambio is a collection object???. And why don't work renaming my methods like Larry said??? -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem using session var
Rafael, Are you sure you used the logic:iterate with the old method signatures and not the new case sensitive getters and setters? Regards, David -Original Message- From: Rafael Taboada [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 9:44 PM Cc: Struts Users Mailing List Subject: Re: Problem using session var I renamed my methods but nothing happened. My new getters and setters: getStrValor() setStrValor() But it's still the same error. But I did this: logic:iterate id=lista name=lstTipoCambio bean:write name=lista property=strValor / /logic:iterate And it worked Do u know why? Because lstTipoCambio is a collection object???. And why don't work renaming my methods like Larry said??? -- Rafael Taboada - 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: Problem using session var
Yes, I used logic:iterate with getstrValor and setstrValor and it worked fine.. But I tried with logic:iterate and getStrValor and setStrValor and it worked too... So, what's the problem???... Is my bean:write name=lstTipoCambio property=strValor / Has it to be inside a iteration method??? Because lstTipoCambio is a collection Id tried withouth logic:iterate and getStrValor and setStrValor but it didn't worked... -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using session var
My bad... I cleaned and rebuilt and It works without logic:iterate and getStrValor and setStrValor and strValor attribute. :) But. Why does it work using logic:iterate and getstrValor and setstrValor? Thanks for help me. -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using session var
Hi! bean write tag just takes a bean under name key form the scope where you indicates with scope or with findAttrinute searching in every scopes if you omit the scope attribute. Once the bean is found, the tag, takes the value of the property attribute as String and -first replace the first letter of this string by the same letter capitalized, -seccond concats this result to the String get -finally the result ys a String with the form getXayz if the ptoprty value of the tag were xayz So the tag has two elements, a bean, and the name of a method, a getter... Via reflection api the getter is executed over the bean, and the result is printed in the screen... all this work is done with common bean utils component so i recommend you visit the page finally the tag will be trying to execute the method getStrValue, on a Set, and this getter is never found so you get an exception i wish it hepls... Lucas Rafael Taboada [EMAIL PROTECTED] escribió: Yes, I used logic:iterate with getstrValor and setstrValor and it worked fine.. But I tried with logic:iterate and getStrValor and setStrValor and it worked too... So, what's the problem???... Is my Has it to be inside a iteration method??? Because lstTipoCambio is a collection Id tried withouth logic:iterate and getStrValor and setStrValor but it didn't worked... -- Rafael Taboada - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - A tu celular ¿no le falta algo? Usá Yahoo! Messenger y Correo Yahoo! en tu teléfono celular. Más información aquí.
Re: html:image and IE
I may be wrong, Dave, but I think you are going to get an integer value for getX and getY and not Update. Isn't that right? That is why the solutions have to be a little more detailed and why we got saddled with the LookupDispatchAction and other heavy solutions. Once again, I think the options at www.michaelmcgrady.com/button are instructive, even if you want to do something different. On 5/11/05, Durham David R Jr Ctr 805 CSPTS/SCE [EMAIL PROTECTED] wrote: form-property name=updateCart.x type=java.lang.String/ form-property name=updateCart.y type=java.lang.String/ From the docs: A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property=). So, you could just do: form-property name=x type=java.lang.String/ form-property name=y type=java.lang.String/ In a JSP: html:image property= value=Update src=/cerebus/store/images/updateCart.gif/ Then in your action: if (((DynaBean)form).get(x).equals(Update) Probably better to use the request parameter though, and not go through the trouble of setting up the form properties. Honestly, I don't see what the image tag really adds beyond some module support via the page attribute. HTH, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:image and IE
Unless Dave is right, Chad,which I don't think he is, the difficulty is that you get as a name/value pair in the request parameters [property].x=[some integer] and [property].y=[some integer] so that the task becomes getting the name which is the property in [property] rather than the value, i.e. [some integer], in the name/value pair. This problem, however, once you solve it simply provides lots of benefits which can be transferred to other areas. Normally the getX() and getY() methods test for null or not null so that you can then detemine which property name was fired. That is what is done well in the suggested options on www.michaelmcgrady.com/button. 'Hope this is helpful. If Dave is right, then I have something else to learn. On 5/11/05, Dakota Jack [EMAIL PROTECTED] wrote: I may be wrong, Dave, but I think you are going to get an integer value for getX and getY and not Update. Isn't that right? That is why the solutions have to be a little more detailed and why we got saddled with the LookupDispatchAction and other heavy solutions. Once again, I think the options at www.michaelmcgrady.com/button are instructive, even if you want to do something different. On 5/11/05, Durham David R Jr Ctr 805 CSPTS/SCE [EMAIL PROTECTED] wrote: form-property name=updateCart.x type=java.lang.String/ form-property name=updateCart.y type=java.lang.String/ From the docs: A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property=). So, you could just do: form-property name=x type=java.lang.String/ form-property name=y type=java.lang.String/ In a JSP: html:image property= value=Update src=/cerebus/store/images/updateCart.gif/ Then in your action: if (((DynaBean)form).get(x).equals(Update) Probably better to use the request parameter though, and not go through the trouble of setting up the form properties. Honestly, I don't see what the image tag really adds beyond some module support via the page attribute. HTH, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Is struts more performant than JSF
The JSF is an event-based framework with tight coupling in a page-based controller. That should answer the question in itself. If you want that, then you will put up with the performance and CPU hit. You might even put up with the performance and CPU hit if you are hell bent on using tools instead of custom coding. I think the tool boys are really not saving in the long run because too much is left to a lack of knowledge which will cost in the long run with maintenance headaches. But, pushing a button is faster than coding at the beginning: no doubt about that. On 5/10/05, Yan Hu [EMAIL PROTECTED] wrote: Hi: I have been playing with JSF lately. I really like it since it is very intuitive. But as I understand it, JSF keeps a component tree for each page with JSF widgets in it on the server. So it is heavy weight compared with struts. Could I safely say that struts-based apps are a bit more performant than JSF ones? someone please shed some light on it... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Add ability of required to handle checkboxes, radio, ... - I GOT A PROBLEM!
Dear All, I'm in trouble of using depends=required in validation.xml for validate radio buttons. If has no any selected the radio buttons. It don't validate anything and I got an errors message WARNING: Unhandled Exception thrown: class java.lang.NullPointerException (I'm using Tomcat 4.1.29) Firstly, i used commons-validator.jar version 1.0.2 .. and i tried to search for more information. They told us about the bug on that version. Then i try to use version 1.1.3 and then 1.1.4 and i looked to this url : http://jakarta.apache.org/commons/validator/changes-report.html i saw that this error has been edited since Release 1.1.1 .. But i'm trying to use new version but it still get the same error. Please suggestion what should I do asap ?? Thank you very much and Best Regards, WangRingRing Disclaimer: This message may contain confidential whether or intended solely for the recipient(s) named above and any other use is prohibited. If you are not the addressee or authorized from BizDimension Co.,Ltd. to receive this message, you must not use, copy, disclose or take any action on this message or any information herein. The BizDimension will not be liable for any loss or damage arising directly or indirectly from the possession, publication or use of or reliance on information obtained, or any damage caused by any virus attached with this message.
Re: My OWN VALIDATOR
Hi Im having a problem with validators this is the error VALIDATION FAILED May 11, 2005 11:29:09 PM org.apache.struts.validator.ValidatorForm validate SEVERE: validator.FMValidator.validateList(java.lang.Object, org.apache.commons. validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts .action.ActionMessages, javax.servlet.http.HttpServletRequest) org.apache.commons.validator.ValidatorException: validator.FMValidator.validateL ist(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.c ommons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.h ttp.HttpServletRequest) at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val idatorAction.java:627) at org.apache.commons.validator.ValidatorAction.executeValidationMethod( ValidatorAction.java:557) at org.apache.commons.validator.Field.validateForRule(Field.java:811) at org.apache.commons.validator.Field.validate(Field.java:890) at org.apache.commons.validator.Form.validate(Form.java:174) at org.apache.commons.validator.Validator.validate(Validator.java:367) at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java :112) at org.apache.struts.action.RequestProcessor.processValidate(RequestProc essor.java:921) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja va:206) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:116 4) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl icationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF ilterChain.java:157) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV alve.java:214) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardContextValve.invokeInternal(Standard ContextValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV alve.java:152) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j ava:137) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j ava:118) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:102) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal ve.java:109) at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValv eContext.java:104) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.jav a:520) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:16 0) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java :799) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce ssConnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java :577) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadP ool.java:683) at java.lang.Thread.run(Thread.java:534) I want to validate that the lists value of my form arent 0 this is the validation method in my FMValidation class public static boolean validateList( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { String value = ValidatorUtils.getValueAsString(bean, field.getProperty()); System.out.println(VALOR:[+value+]); if (!GenericValidator.isBlankOrNull(value)) { try { if (value.equalsIgnoreCase(0)) { System.out.println(VALOR 0); errors.add(field.getKey(), Resources.getActionMessage(request, va, field)); return false; } } catch (Exception e) { errors.add(field.getKey(), Resources.getActionMessage(request, va, field)); return false; } }
Re: html:image and IE
David, could you please indicate which docs you are talking about and give a reference? Thanks. On 5/11/05, Durham David R Jr Ctr 805 CSPTS/SCE [EMAIL PROTECTED] wrote: form-property name=updateCart.x type=java.lang.String/ form-property name=updateCart.y type=java.lang.String/ From the docs: A way of retrieving these values through a form bean is to define getX(), getY(), setX(), and setY() methods, and specify your property as a blank string (property=). So, you could just do: form-property name=x type=java.lang.String/ form-property name=y type=java.lang.String/ In a JSP: html:image property= value=Update src=/cerebus/store/images/updateCart.gif/ Then in your action: if (((DynaBean)form).get(x).equals(Update) Probably better to use the request parameter though, and not go through the trouble of setting up the form properties. Honestly, I don't see what the image tag really adds beyond some module support via the page attribute. HTH, Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
quick Digester help
linked-forms parent-form name=article child-form name=comment field=article / /parent-form /linked-forms got 3 classes, one for each XML node type. at the end, linked-forms is a custom HashMap(parent-form.name, List-of(child-form)). in this setup the parent-form bean becomes obsolete although this setup works fine. i would like to remove use of the parent-form class altogether. what i don't know is how to call method HashMap.put(key, val) from digester. i suppost i would have to create a temp class. but i don't know what goes in it :(. help needed :) Digester digester = new Digester(); digester.setValidating(false); digester.addObjectCreate(linked-forms, LinkedForms.class); digester.addObjectCreate( linked-forms/parent-form, ParentForm.class); digester.addSetProperties( linked-forms/parent-form, name, name); digester.addObjectCreate( linked-forms/parent-form/child-form, ChildForm.class); digester.addSetProperties( linked-forms/parent-form/child-form, name, name); digester.addSetProperties( linked-forms/parent-form/child-form,field,field); digester.addSetNext( linked-forms/parent-form/child-form, addChildForm); digester.addSetNext(linked-forms/parent-form, addLinkedForm); thanx riyaz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: My OWN VALIDATOR
This is the same problem you had with your other custom validation method - the parameters you've defined in the validation configuration file don't match your method signature. http://www.mail-archive.com/user@struts.apache.org/msg26221.html http://www.mail-archive.com/user@struts.apache.org/msg26175.html Niall - Original Message - From: Metal KoRn [EMAIL PROTECTED] Sent: Thursday, May 12, 2005 5:42 AM VALIDATION FAILED May 11, 2005 11:29:09 PM org.apache.struts.validator.ValidatorForm validate SEVERE: validator.FMValidator.validateList(java.lang.Object, org.apache.commons. validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts .action.ActionMessages, javax.servlet.http.HttpServletRequest) org.apache.commons.validator.ValidatorException: validator.FMValidator.validateL ist(java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.c ommons.validator.Field, org.apache.struts.action.ActionMessages, javax.servlet.h ttp.HttpServletRequest) at org.apache.commons.validator.ValidatorAction.loadValidationMethod(Val idatorAction.java:627) at org.apache.commons.validator.ValidatorAction.executeValidationMethod( ValidatorAction.java:557) at org.apache.commons.validator.Field.validateForRule(Field.java:811) at org.apache.commons.validator.Field.validate(Field.java:890) at org.apache.commons.validator.Form.validate(Form.java:174) at org.apache.commons.validator.Validator.validate(Validator.java:367) at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java :112) I want to validate that the lists value of my form arent 0 this is the validation method in my FMValidation class public static boolean validateList( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { the validation rules is this !-- VALIDADOR DE LOS VALORES DE LAS LISTAS-- validator name=listas classname=validator.FMValidator method=validateList methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionMessages, org.apache.commons.validator.Validator, javax.servlet.http.HttpServletRequest depends= msg=errors.list/ and my validation is the following (NOTE: the list name Im validating is escuela) field property=escuela depends=listas arg0 key=escuela/ /field - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]