Re: Curious how others handle these situations..
Hi Rick, This is the approach what i have taken.. 1) I had all forms set to Session Scope in the Struts config. 2) Maintain an "actionStack" form variable in all the form, which would keep track of all the required actions as CSV in FILO order(Login,PlayerSearch,EditPlayer,..) 3) Maintain an "action" Variable in each form where ever needed to put the action into the stack. (we had a jsp tag written to put the "action" value to the actionstack for each form submitted as request attribute & put this actionStack in request scope for next form) 4) when u need to go back to the previous action fetch it from the actionStack and forward it to that action path(also remove that action from the stack). This also helps u to even facilitate back button on the menu which will be a very generic approach. HTH Dinesh On Mon, 25 Oct 2004 21:09:47 -0400, Rick Reumann <[EMAIL PROTECTED]> wrote: > Andrew Hill wrote the following on 10/25/2004 8:41 PM: > > > > > > > In your case you probably dont need to go as far as I did. You could > > perhaps just keep track of the pages in the stack in a session scoped > > collection and override the requestProcessor to look in that collection > > for the form instead of instantiating it. If it finds a form in that > > collection it can use that (storing it under the normal key in the > > session (or even request actually. Hmm) where the other strust things > > (like tags) will look. (You will note we need to go via an action rather > > than hitting any JSPs directly here so that we make a trip through the > > requestProcessor where our code will find the form and put it in the > > appropriate place!) > > Yea, I thought about some kind of session manager but too close to > crunch time to get the application out. I'll just make sure we have tons > and tons of RAM if performance becomes a problem:) > > -- > Rick > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Dinesh B Sampangi Software Engineer FCG Software Services, Brigade Road,Bangalore - 560025 Ph: 5691 ext:2523 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts form problem.
The NPE is thrown on this line: obj = formBeanClass().newInstance(); in the FormBeanConfig -- this indicates that the class you specified by the type attribute cannot be found -- check for typos and how you are building your deployment as well. -Bill Siggelkow Matias Surdi wrote: Please, Help I'm stuck since two days ago with this. It's the exception, when I try to open a jsp from de browser: The exception: -- (util.RequestUtils 306 ) Error creating form bean of class ar.com.byosoft.webportal.forms.LoginForm java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:214) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:294) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:193) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:453) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:433) at org.apache.jsp.jsp.common.left_jsp._jspx_meth_html_form_0 (left_jsp.java:360) at org.apache.jsp.jsp.common.left_jsp._jspx_meth_logic_empty_0 (left_jsp.java:335) at org.apache.jsp.jsp.common.left_jsp._jspService(left_jsp.java:116) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:581) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460) at org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_tiles_insert_1 (layout_jsp.java:194) at org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_html_html_0 (layout_jsp.java:124) at org.apache.jsp.jsp.layout.layout_jsp._jspService(layout_jsp.java:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:237) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:300) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.
Re: Article: Skin Web applications using Xkins (with Struts)
Hi Guillermo Thanks for posting that link. Just what I needed to see. I am about to look at implementing skins for my current web app, so it was timely. Regards, Langdon Guillermo Meyer wrote: If anyone is interested in skinning a Struts web application, you can read this article at http://www.javaworld.com/javaworld/jw-10-2004/jw-1025-xkins.html. This is an introduction to Xkins Framework and has an example that uses Xkins and Struts. Regards. Guillermo Meyer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Curious how others handle these situations..
Andrew Hill wrote the following on 10/25/2004 8:41 PM: In your case you probably dont need to go as far as I did. You could perhaps just keep track of the pages in the stack in a session scoped collection and override the requestProcessor to look in that collection for the form instead of instantiating it. If it finds a form in that collection it can use that (storing it under the normal key in the session (or even request actually. Hmm) where the other strust things (like tags) will look. (You will note we need to go via an action rather than hitting any JSPs directly here so that we make a trip through the requestProcessor where our code will find the form and put it in the appropriate place!) Yea, I thought about some kind of session manager but too close to crunch time to get the application out. I'll just make sure we have tons and tons of RAM if performance becomes a problem:) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tab UI controls for struts
Have you looked at tiles-documentation.war? - Original Message - From: "kjc" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 7:23 PM Subject: Re: tab UI controls for struts I see that struts has a Tabbed Layout. Are there any examples around on how to use it. Eddie Bush wrote: Try Tiles. It has a tabbed-layout, I believe. If that doesn't suit your needs, try: Google Query: Struts +Layout +Tabbed - Original Message - From: "kjc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 10:36 AM Subject: tab UI controls for struts looking for a tab UI control for use with struts. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0443-3, 10/22/2004 Tested on: 10/25/2004 7:04:41 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0443-3, 10/22/2004 Tested on: 10/25/2004 7:24:09 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Curious how others handle these situations..
Hi Rick, I did this for a large application where there were a lot of different record types with various linkages much as your roster has with players, and where said linkages could nest quite deeply. You will need to use the session to do it cleanly. The idea is to somehow keep a stack of ActionForms. Another need I had was to allow several such page-flows to go on simultaneusly in multiple windows (which session scoped forms would have problems with). In my case I went so far as to implement a new scope - the 'operation context' - which is basically a sort of sub-session identified with a unique id which is its attribute key in the session, passed in the request url. It consists of a map and some other properties and methods. I overrode the request processor to allow for my actionForms to be stored in this context. I also needed to bang up a fair bit of support code to deal with things like cleaning up the operation contexts at the appropriate time etc... The operation contexts can be stacked, and the term I came up with to describe the act of putting aside the current one to go work on another with the ability to come back later was "diversion", so when the user "diverts" to another page the dispatch action will note that they are diverting to X (based on some hidden field set when the user clicks the link or button to divert) , will push a new operation context onto the stack for that operation context id, and forward to the appropriate action (for which the requestProcessor will instantiate the new form and store it in the operation context as normal). When the user has finished playing with X (ie they save the changes or cancel) the action will pop that operationContext replacing the previous one at the top of the stack and a url or forward name or such like stored as a property in that operation context tells it which action to go back to after that to continue where the user left off. Obviously since your using a stack you can divert multiple levels as deep as you want... Since the operation context has its own attributes (lie session and request) one can also use these to pass info between the actions and then do a redirecting forward (where the operation id is encoded as a url parameter). The application I did this for is quite complex and has a lot of configuration that can be done through the ui. There are many different record types that the administrator can create and edit, and most have relationships to various other records (that have their own dependencies ad infinitum...) that would normally have to be created first, making the process quite tedious. By implementing 'diversions' however I was able to make the application practically guide the admin users through the process almost like a wizard but much much more flexible. Since there arent all that many admin users for any particluar deployment of the app, the memory overhead for using the session like this wasnt significant, while the huge boost in user-friendliness was. :-) In your case you probably dont need to go as far as I did. You could perhaps just keep track of the pages in the stack in a session scoped collection and override the requestProcessor to look in that collection for the form instead of instantiating it. If it finds a form in that collection it can use that (storing it under the normal key in the session (or even request actually. Hmm) where the other strust things (like tags) will look. (You will note we need to go via an action rather than hitting any JSPs directly here so that we make a trip through the requestProcessor where our code will find the form and put it in the appropriate place!) hth Andrew Rick Reumann wrote: To cut to the chase.. Imagine a hypothetical UI where you have checkboxes next to football players and by checking the boxes and hitting 'save' you would be saving a roster. Typically you'd have a FormBean to capture this information and probably a "RosterAction". Now also imagine that next to each player on the above list where you set up the roster, there is also an 'edit' button that lets you edit the player. In the application this will not be the only way you can get to edit a player so its behavior needs to be self contained (ie "PlayerAction"). The question I have is, how do you guys handle situations where you need to get 'back' to different pages depending on where the user was? For example, in the above scenario, after a user edits a player, I want the user to be forwarded "back" to the same roster selection screen with what he was working on - what he's checked - still selected. However, if maybe the user is getting to the edit a player functionality from a search screen of search results where he searched for a player to edit, I want the user returned to that screen. The only clean way sort of clean way I've found to accomplish this is to rely heavily on the use of Session. For example if the Session is used t
Re: [Struts-Chain] how to use another chain for preprocessing?
To chain actions, you simply return a non-redirect ActionForward which points to a Struts action path. This is chaining (where a redirect isn't) because it results in the ActionServlet triggering a second "run" through the RequestProcessor's processing flow. OK, that's what I was thinking, along with using the trick to set the arguments on your forwards (see http://wiki.apache.org/struts/ForwardingWithDifferentParameter) This can have some unexpected side effects, which is one reason it's not considered "supported behavior". Also, as Ted notes on the references Wiki pages, when people chain actions, it is often (though not always) because they haven't got a clean controller architecture. Fair enough. I notice that the email from Craig included in that page is over two years old and heavily references the transition from Struts 1.0 to Struts 1.1; is that still useful this far on? I don't think so. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serious performance impact with iterator
JoAnn, Please don't take this wrong, but it is considered quite rude to email the list in such quick succession. Believe it or not, most of the people on the list actually work and have things to do other than check for new messages every 2 minutes. In fact, it's only by people volunteering to answer questions that questions get answered. Nobody gets paid to do it! My apologies if you feel my response is rude. It's not meant to be rude. It is meant to help you realize that, by spamming the list like you did with this message, you're potentially alienating the very people who might be able to help you. In other words, you're likely to get ignored. Most questions get answered pretty quickly, considering nobody is paid to answer questions. If your question is not met with an answer, it could be that the person who can answer it is busy -- or, viewed another way -- that nobody reading the question is knowledgable enough to answer you. Myself, I work from about 7:00 a.m. til about 6:00 p.m. Sometimes I get a lunch! I'm unable to view messages on the list until I get home though. I do however try my best to scout for unanswered questions and give the best response I can. Sometimes I have to do some research before I can do that - sometimes I don't. If I were in the process of replying to your message, and I saw you spamming the list like you did, I would cancel my response - even if I only lacked pressing the "Send" button. Please don't do that anymore :-) Eddie - Original Message - From: "JoAnn Lemm" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 6:07 PM Subject: FW: Serious performance impact with iterator Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows of data to display! Anyone have a solution for this? A patch somewhere? Aiken Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0443-3, 10/22/2004 Tested on: 10/25/2004 7:32:44 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Struts Networking / BOF IV / Friday / October 22 @ 19: 3 0 / Restaurant / The Furnace
Pilgrim, Peter wrote: > Hi > Please see intermixed > ---- The BOF IV took place at The Furnace restuarant The following people are attending so far: Peter Pilgrim Alan Mehio Thomas Pluempe Tim Penhey Charles Cordingley Marco Mistroni Niall Pemberton Allister Snedon Apologies for Absence Christopher Marsh-Bourdon Topics Discussed (*) IoC Frameworks, principles of inversion of-control Why? How? (*) Eclipse Development environment working with My Eclipse (*) Hani Suleiman Bile Blog, various other Blogs on JRoller.com http://www.jroller.com/page/fate/ http://www.jroller.com/page/peter_pilgrim (*) Future of Struts Development, wishlist to simplify the design. i.e ActionForm should have bean an Java interface. In JSF there is a managed bean. Niall discussed a wrapper to make any bean an action form. (*) Why is Struts Chain not a simple interface and implementation of the chain of responsibility pattern? Why does it have to have portlets and servlets built into the package? (*) Why does it take so long to get a Struts Release out of the door? (*) What is exactly in Struts 1.2.4 release? (*) Political angles between Struts and Java Server Faces? (*) Postgres Database 8 availability for Windows Env Subscribe to window postgres sql hacker list instead of general announcements. (*) Why is postgres better than Mysql for ACID transactions? (*) Why is MysSQL ISAM tables faster than anything else out there (for non-TX stuff). (*) WebLogic Server, difficult of debugging EJBs thereof (*) The difficult of getting approval from business leaders, who sanction the library version for a whole enterprises. The classic statement: "If it is not a FCS version, then you cannot use that JAR in our company X.". (*) Related to the above, avoid polluting the dependencies of different JARs, just so that such dependencies between essential libraries cannot be minimised. Some organisation have to explain every dependency and class in a JAR. Why is it required? What it is? Where is it exactly been used? Did I miss everything? === F E E D B A C K S H E E T === I'd like to thanks all the participants that attendeded last Friday night. I think it was a great and successful night. Can you grant me a favour and fill out a feed back sheet so we can improve this event? F1: What did you really want to discuss at the Networking? Your personal comment here [ ] Would you like to have an agenda of discussion for all meetings? [ ] Yes [ ] No F2: What do you prefer Public Bar or Restuarant? [ ] Pub [ ] Restaurant [ ] Other, your personal venue suggestion [ ] F3: Which night of the week is best for you? [ ] Monday [ ] Wednesday [ ] Friday Other night [ ] F4: Was the networking usefully for you? What is helpful that you learnt something new> [ ] Fantastico [ ] Rather useful [ ] Not quite so useful for me [ ] It was a waste of time F5: Is the size of the event good enough for you? [ ] Yes [ ] No F6: Did you meet and circulate to the other networkers? [ ] Yes [ ] Somewhat [ ] No F7: Do you have any suggestions for improvement [ ] F8: Are you interested in Xmas BOF V 2004 (early December)? [ ] Yes [ ] No Would you like to take part in November quick meet up or just leave it for the Xmas BOF? [ ] Yes [ ] No ==== Website Details www.strutslondon.com Just me killing four birds with one stone. This is me. Out! -- Peter Pilgrim __ _ _ _ / //__ // ___// ___/ + Serverside Java / /___/ // /__ / /__ + Struts / // ___// ___// ___/ + Expresso Committer __/ // /__ / /__ / /__ + Independent Contractor /___/////// + Intrinsic Motivation On Line Resume || \\===> `` http://www.xenonsoft.demon.co.uk/no-it-striker.html '' - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tab UI controls for struts
I see that struts has a Tabbed Layout. Are there any examples around on how to use it. Eddie Bush wrote: Try Tiles. It has a tabbed-layout, I believe. If that doesn't suit your needs, try: Google Query: Struts +Layout +Tabbed - Original Message - From: "kjc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 10:36 AM Subject: tab UI controls for struts looking for a tab UI control for use with struts. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0443-3, 10/22/2004 Tested on: 10/25/2004 7:04:41 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tab UI controls for struts
Try Tiles. It has a tabbed-layout, I believe. If that doesn't suit your needs, try: Google Query: Struts +Layout +Tabbed - Original Message - From: "kjc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, October 25, 2004 10:36 AM Subject: tab UI controls for struts looking for a tab UI control for use with struts. --- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0443-3, 10/22/2004 Tested on: 10/25/2004 7:04:41 PM avast! - copyright (c) 2000-2004 ALWIL Software. http://www.avast.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to use tiles to render dynamic pages
Hi, We have an application that displays 4 columns of data in a page. The number of columns is configurable by the admin and also by the user. The minimum number of columns displayed is 2. If a column is not displayed then the space allocated for it needs to be taken up by other columns. Is there an easy way of doing this using tiles? Do I have to write custom code in my JSP to look up the user/admin choices and then display the columns and also resize them? Or is there any built in controller that can help me with that? Thanks, -Monica - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serious performance impact with iterator
If you are using tomcat you could look at the trimSpaces option for JSP page compilation in server.xml There are also filters that can be used to compress the page as it is being sent to the browser. You can also try writing out tags differently to minimise spaces produced in source eg ... ... ... The spaces inside a tag will not be output to the page. So by putting the indentations there, you can see them in the code but not the html that is sent to the browser. Eg abc will produce 'abcabcabcabc' where as abc will produce 'abc abc abc abc' JoAnn Lemm wrote: Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows with 10 columns of data to display! Anyone have a solution for this? A patch somewhere? Do I resort to using *gasp* scriptlets? style='BORDER-COLLAPSE: collapse' bordercolor='#11'> align="center" bgcolor='#ff'> target="_top"> Aiken target="_top"> Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Jason Lea - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Serious performance impact with iterator
From: "JoAnn Lemm" <[EMAIL PROTECTED]> > I'm wondering if anyone else is seeing this impact. > The resulting html looks like the following. Note all the empty spaces. > Needless to say, this has impacted performance on the website > significantly by increasing the size of the page to something ludicrous > when I have more than 20 rows of data to display! > Anyone have a solution for this? A patch somewhere? Can you switch to using the JSTL tag instead of logic:iterate? I use that and don't have multiple blank lines showing up on each iteration. You could also put a Filter on the webapp and remove extraneous spaces from the outbound HTML response. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Serious performance impact with iterator
Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows of data to display! Anyone have a solution for this? A patch somewhere? Aiken Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FW: Serious performance impact with iterator
Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows of data to display! Anyone have a solution for this? A patch somewhere? Aiken Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Serious performance impact with iterator
Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows with 10 columns of data to display! Anyone have a solution for this? A patch somewhere? Do I resort to using *gasp* scriptlets? Aiken Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Article: Skin Web applications using Xkins (with Struts)
I thought JavaWorld was dead. If it has returned to the living that is great news. Guillermo Meyer wrote: If anyone is interested in skinning a Struts web application, you can read this article at http://www.javaworld.com/javaworld/jw-10-2004/jw-1025-xkins.html. This is an introduction to Xkins Framework and has an example that uses Xkins and Struts. Regards. Guillermo Meyer. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Serious performance impact with iterator
Hey All, I'm wondering if anyone else is seeing this impact. I've got an iterator within an iterator thusly: The resulting html looks like the following. Note all the empty spaces. Needless to say, this has impacted performance on the website significantly by increasing the size of the page to something ludicrous when I have more than 20 rows of data to display! Anyone have a solution for this? A patch somewhere? Aiken Glenda JoAnn Lemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Article: Skin Web applications using Xkins (with Struts)
If anyone is interested in skinning a Struts web application, you can read this article at http://www.javaworld.com/javaworld/jw-10-2004/jw-1025-xkins.html. This is an introduction to Xkins Framework and has an example that uses Xkins and Struts. Regards. Guillermo Meyer.
lossing the values when returing to jsp if any error in Action class
Hi I have a jsp which has a dropdown box, in my dispatch Action class i populate a ArrayList and store in request and pass it to my jsp, the user then selects one value from this dropdown and hits enter, In my action class i call the business logic class, which tries to insert this value in database, If this value exist i get an SQL error, then i have to display this SQL error on the jsp and also the dropdown box, but when i get back to my jsp the dropdown box is empty, i.e. the arraylist is empty. How do i retain this arraylist in my Action class?? In my action class i have the following code,. if there is no error i remove the bean from request scope if(noError) { if (mapping.getAttribute() != null) { if ("request".equals(mapping.getScope())) { request.removeAttribute(mapping.getAttribute()); } else { request.getSession().removeAttribute(mapping.getAttribute()); } } return mapping.findForward(MapsConstants.SUCCESS); } = A$HI$H __ Do you Yahoo!? Y! Messenger - Communicate in real time. Download now. http://messenger.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts form problem.
Please, Help I'm stuck since two days ago with this. It's the exception, when I try to open a jsp from de browser: The exception: -- (util.RequestUtils 306 ) Error creating form bean of class ar.com.byosoft.webportal.forms.LoginForm java.lang.NullPointerException at org.apache.struts.config.FormBeanConfig.createActionForm(FormBeanConfig.java:214) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:294) at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:193) at org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:453) at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:433) at org.apache.jsp.jsp.common.left_jsp._jspx_meth_html_form_0 (left_jsp.java:360) at org.apache.jsp.jsp.common.left_jsp._jspx_meth_logic_empty_0 (left_jsp.java:335) at org.apache.jsp.jsp.common.left_jsp._jspService(left_jsp.java:116) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:590) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:510) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966) at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:581) at org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101) at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137) at org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758) at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890) at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460) at org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_tiles_insert_1 (layout_jsp.java:194) at org.apache.jsp.jsp.layout.layout_jsp._jspx_meth_html_html_0 (layout_jsp.java:124) at org.apache.jsp.jsp.layout.layout_jsp._jspService(layout_jsp.java:81) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:704) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:474) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056) at org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261) at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:237) at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:300) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1158) at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397) at javax.servlet.http.HttpServlet.service(HttpServlet.java:689) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) at org
Re: file validation best practice - Thanks everyone
Thanks very much. --- Joe Germuska <[EMAIL PROTECTED]> wrote: > At 7:24 AM -0700 10/25/04, struts lover wrote: > >Hello, > >Thanks everyone for your interest and replies. > Thanks > >very much. > >I had one more question. If I use getContentType() > of > >FormFile, does it give the same results on > different > >operating systems that is if the client is using > >different operating systems. > > Yes, the client determines by its own mechanisms > what MIME type to > send. For a specific example, MSIE insists on > labeling all JPEG > images as "image/pjpeg". This is annoying because > we use a > third-party application which explodes when it tries > to process > progressive JPEGs. We've had to institute a process > which "resaves" > all JPEGs explicitly as not-progressive. It would > be nice if MSIE > would tell the truth, so we could only use that > process when we > really need it, although I suppose given how badly > the third-party > app response to PJPEGs, it's probably safest that we > do this anyway. > > >Does the change in server OS affects the > >getContentType() result. > > No, it shouldn't, because it simply accepts whatever > is sent by the client. > > Joe > > -- > Joe Germuska > [EMAIL PROTECTED] > http://blog.germuska.com > "In fact, when I die, if I don't hear 'A Love > Supreme,' I'll turn > back; I'll know I'm in the wrong place." > - Carlos Santana __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
user@struts.apache.org
Hi Is there a simple example of how to use html:options tag How do i define the bean in struts-config.xml file, and how do i use it in my jsp Currenty i have defined the following in struts-config.xml In my Action form i populate this bean and set it in request scope, in my jsp i used to following tag No getter method available for property MASTERVENDOR for bean under name VendorCollectionForm I am populating VendorCollectionForm with a class called VenMaster which has getMASTERVENDOR() and getDESCRIPTION() method How do i get it working Ashish __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Implementing dependence between form properties
Something like this if youre using 1.2.x: test ((item1 != null) or (item2 != null) or (*this* != null)) > -Original Message- > From: news [mailto:[EMAIL PROTECTED] Behalf Of Laurent Duperval > Sent: Monday, October 25, 2004 5:13 PM > To: [EMAIL PROTECTED] > Subject: Implementing dependence between form properties > > > Hi, > > How does one implement dependence between property fields? > Specifically, > I have three String fields and at least one of them must be non-null. > Can I write this in the validator.xml file? Or do I have to write a > custom validation rule? > > Thanks, > > L > > > - > 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]
Implementing dependence between form properties
Hi, How does one implement dependence between property fields? Specifically, I have three String fields and at least one of them must be non-null. Can I write this in the validator.xml file? Or do I have to write a custom validation rule? Thanks, L - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionMessages question (simple)
Caro Vinicius, Your java code is fine. But you got confused on the struts tags. If you want to display ALL the messages you have, (that's probably what you need) one under the other, separated by 's, you would use: But if you only want to display that "removido" message when it exists, you can use: The html:messages tag loops over all of the items in your ActionMessages object. The "id" is the label of the "current message instance" in the loop. The "name" in the bean:write tag in this case corresponds to the label you gave to "current message instance". Um abraco, Thompson Vinicius Carvalho wrote: I'm kinda lost with this. I set a message like below : ActionMessages msgs = new ActionMessages(); msgs.add("removido", new ActionMessage("br.com.auge.bancoprojetos.registroRemovido")); saveMessages(request,msgs); Than I want to display it: That's not working anyway I'm kinda lost with id and name as well, which one is which?? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionMessages question (simple)
I'm kinda lost with this. I set a message like below : ActionMessages msgs = new ActionMessages(); msgs.add("removido", new ActionMessage("br.com.auge.bancoprojetos.registroRemovido")); saveMessages(request,msgs); Than I want to display it: That's not working anyway I'm kinda lost with id and name as well, which one is which?? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error handling basics
No worries, Freddy -- in fact, I apologize; I just wasn't reading careful enough. I am glad you solved your problem. -Bill Siggelkow Freddy Villalba A. wrote: By the way... I was being sarcastic with my last comment, Bill. Second-read it and thought it could have been offensive / rude. Thanx again. -Mensaje original- De: Freddy Villalba A. [mailto:[EMAIL PROTECTED] Enviado el: lunes, 25 de octubre de 2004 20:01 Para: Struts Users Mailing List Asunto: RE: Error handling basics Yes, I did: input="admin_customers.jsp" However, I've noticed the problem(s): - I was missing a "/". - The MessageResource's file is required. - I was constructing the ActionError instance using the message itself, instead of the message key to locate the right message within the MessageResource's file. As if u hadn't noticed, it's been a while since I coded some Struts for the last time... Thanx everybody, Freddy. -Mensaje original- De: news [mailto:[EMAIL PROTECTED] nombre de Bill Siggelkow Enviado el: lunes, 25 de octubre de 2004 19:13 Para: [EMAIL PROTECTED] Asunto: Re: Error handling basics Hmmm... it looks like you *didn't* specify the input attribute on the mapping. Freddy Villalba A. wrote: Hello, I've made myself a small test application. I wanted to test error handling within the "validate" method. The problem is that I'm not being redirected to the jsp I have specified inside the "input" attribute. Instead, I'm getting a blank page (with no error messages at all inside). This is the validate method in my form: public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if ((this.getName() == null) || this.getName().trim().equals("")) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a name")); } if (errors.isEmpty()) { return null; } else { return errors; } } This is the mapping inside my struts-config.xml: I'm not using the tag (I believe it's not mandatory to use one). Am i missing something? Thanx, Freddy. P.S.: I've debugged the RequestProcessor and it seems to be stopping - without throwing an exception or anything else - when trying to execute the following line: RequestDispatcher rd = getServletContext().getRequestDispatcher(uri); and my web application's context root is "wa" (http://localhost:8080/wa/createCustomer.do) - 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: Cannot find message resources under key org.apache.struts.action.MESSAGE
OK, I got it working it seems you know HAVE to specify the resouces in the struts configuration as and not in the web.xml anymore as a parameter to the action servlet. Might be helpful to other people. Charl parameter="com.systemmobile.example.ApplicationResources"/> --- Charl Gerber <[EMAIL PROTECTED]> wrote: > The file is definitely there: > > ApplicationResources.properties > in my WEB-INF/classes, configured as: > > > action > > org.apache.struts.action.ActionServlet > > application > > ApplicationResources > > > config > > /WEB-INF/conf/struts.xml > > > debug > 2 > > 2 > > > Any other ideas? > > > > --- "Carl F. Hall" <[EMAIL PROTECTED]> wrote: > > I had this problem when I didn't have a message > > resources file. I don't use > > one currently so I had to create a blank file then > > reference it in my > > struts-config file. > > > > Hope this helps. > > > > -Original Message- > > From: Charl Gerber [mailto:[EMAIL PROTECTED] > > Sent: Monday, October 25, 2004 3:02 PM > > To: Struts Users Mailing List > > Subject: Cannot find message resources under key > > org.apache.struts.action.MESSAGE > > > > I've upgraded from Struts 1.1 to 1.2.4. The only > > changes are the new jars and ActionError has been > > replaced by ActionMessage. Nothing else. Now I get > > the > > exception: > > > > Cannot find message resources under key > > org.apache.struts.action.MESSAGE > > > > I read it might have something to do with xml > > parsers, > > but I have made sure that only xerces 2.6.2 is in > my > > WEB-INF/lib. > > > > Any other ideas what this could be? > > > > Thanks. > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot find message resources under key org.apache.struts.action.MESSAGE
The file is definitely there: ApplicationResources.properties in my WEB-INF/classes, configured as: action org.apache.struts.action.ActionServlet application ApplicationResources config /WEB-INF/conf/struts.xml debug 2 2 Any other ideas? --- "Carl F. Hall" <[EMAIL PROTECTED]> wrote: > I had this problem when I didn't have a message > resources file. I don't use > one currently so I had to create a blank file then > reference it in my > struts-config file. > > Hope this helps. > > -Original Message- > From: Charl Gerber [mailto:[EMAIL PROTECTED] > Sent: Monday, October 25, 2004 3:02 PM > To: Struts Users Mailing List > Subject: Cannot find message resources under key > org.apache.struts.action.MESSAGE > > I've upgraded from Struts 1.1 to 1.2.4. The only > changes are the new jars and ActionError has been > replaced by ActionMessage. Nothing else. Now I get > the > exception: > > Cannot find message resources under key > org.apache.struts.action.MESSAGE > > I read it might have something to do with xml > parsers, > but I have made sure that only xerces 2.6.2 is in my > WEB-INF/lib. > > Any other ideas what this could be? > > Thanks. > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Cannot find message resources under key org.apache.struts.action.MESSAGE
I had this problem when I didn't have a message resources file. I don't use one currently so I had to create a blank file then reference it in my struts-config file. Hope this helps. -Original Message- From: Charl Gerber [mailto:[EMAIL PROTECTED] Sent: Monday, October 25, 2004 3:02 PM To: Struts Users Mailing List Subject: Cannot find message resources under key org.apache.struts.action.MESSAGE I've upgraded from Struts 1.1 to 1.2.4. The only changes are the new jars and ActionError has been replaced by ActionMessage. Nothing else. Now I get the exception: Cannot find message resources under key org.apache.struts.action.MESSAGE I read it might have something to do with xml parsers, but I have made sure that only xerces 2.6.2 is in my WEB-INF/lib. Any other ideas what this could be? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Cannot find message resources under key org.apache.struts.action.MESSAGE
I've upgraded from Struts 1.1 to 1.2.4. The only changes are the new jars and ActionError has been replaced by ActionMessage. Nothing else. Now I get the exception: Cannot find message resources under key org.apache.struts.action.MESSAGE I read it might have something to do with xml parsers, but I have made sure that only xerces 2.6.2 is in my WEB-INF/lib. Any other ideas what this could be? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error handling basics
By the way... I was being sarcastic with my last comment, Bill. Second-read it and thought it could have been offensive / rude. Thanx again. -Mensaje original- De: Freddy Villalba A. [mailto:[EMAIL PROTECTED] Enviado el: lunes, 25 de octubre de 2004 20:01 Para: Struts Users Mailing List Asunto: RE: Error handling basics Yes, I did: input="admin_customers.jsp" However, I've noticed the problem(s): - I was missing a "/". - The MessageResource's file is required. - I was constructing the ActionError instance using the message itself, instead of the message key to locate the right message within the MessageResource's file. As if u hadn't noticed, it's been a while since I coded some Struts for the last time... Thanx everybody, Freddy. -Mensaje original- De: news [mailto:[EMAIL PROTECTED] nombre de Bill Siggelkow Enviado el: lunes, 25 de octubre de 2004 19:13 Para: [EMAIL PROTECTED] Asunto: Re: Error handling basics Hmmm... it looks like you *didn't* specify the input attribute on the mapping. Freddy Villalba A. wrote: > Hello, > > I've made myself a small test application. I wanted to test error handling > within the "validate" method. The problem is that I'm not being redirected > to the jsp I have specified inside the "input" attribute. Instead, I'm > getting a blank page (with no error messages at all inside). > > This is the validate method in my form: > > public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest > httpServletRequest) { > ActionErrors errors = new ActionErrors(); > if ((this.getName() == null) || > this.getName().trim().equals("")) { > errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a > name")); > } > if (errors.isEmpty()) { > return null; > } else { > return errors; > } > } > > This is the mapping inside my struts-config.xml: > > path="/createCustomer" scope="request" > type="com.x.sgp.presentation.struts.invoice.CreateCustomerAction" > validate="true"> > >redirect="true" /> > > > > I'm not using the tag (I believe it's not mandatory to > use one). > > Am i missing something? > > Thanx, > Freddy. > > P.S.: I've debugged the RequestProcessor and it seems to be stopping - > without throwing an exception or anything else - when trying to execute the > following line: > > RequestDispatcher rd = getServletContext().getRequestDispatcher(uri); > > and my web application's context root is "wa" > (http://localhost:8080/wa/createCustomer.do) - 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: Error handling basics
Yes, I did: input="admin_customers.jsp" However, I've noticed the problem(s): - I was missing a "/". - The MessageResource's file is required. - I was constructing the ActionError instance using the message itself, instead of the message key to locate the right message within the MessageResource's file. As if u hadn't noticed, it's been a while since I coded some Struts for the last time... Thanx everybody, Freddy. -Mensaje original- De: news [mailto:[EMAIL PROTECTED] nombre de Bill Siggelkow Enviado el: lunes, 25 de octubre de 2004 19:13 Para: [EMAIL PROTECTED] Asunto: Re: Error handling basics Hmmm... it looks like you *didn't* specify the input attribute on the mapping. Freddy Villalba A. wrote: > Hello, > > I've made myself a small test application. I wanted to test error handling > within the "validate" method. The problem is that I'm not being redirected > to the jsp I have specified inside the "input" attribute. Instead, I'm > getting a blank page (with no error messages at all inside). > > This is the validate method in my form: > > public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest > httpServletRequest) { > ActionErrors errors = new ActionErrors(); > if ((this.getName() == null) || > this.getName().trim().equals("")) { > errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a > name")); > } > if (errors.isEmpty()) { > return null; > } else { > return errors; > } > } > > This is the mapping inside my struts-config.xml: > > path="/createCustomer" scope="request" > type="com.x.sgp.presentation.struts.invoice.CreateCustomerAction" > validate="true"> > >redirect="true" /> > > > > I'm not using the tag (I believe it's not mandatory to > use one). > > Am i missing something? > > Thanx, > Freddy. > > P.S.: I've debugged the RequestProcessor and it seems to be stopping - > without throwing an exception or anything else - when trying to execute the > following line: > > RequestDispatcher rd = getServletContext().getRequestDispatcher(uri); > > and my web application's context root is "wa" > (http://localhost:8080/wa/createCustomer.do) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:form doesn't return action
That is a cut and paste error. Sorry about that. I've fixed it below. The way I can find around this right now is to do some manual bean setting for the form and not use the html:form tag. Any thoughts, anyone? -Original Message- From: news [mailto:[EMAIL PROTECTED] On Behalf Of Bill Siggelkow Sent: Monday, October 25, 2004 12:46 PM To: [EMAIL PROTECTED] Subject: Re: html:form doesn't return action I don't know if this is a cut-and-paste error but you are missing a '>' in your action mapping after ' parameter="method" ' Carl F. Hall wrote: > Whenever I use html:form, I only get the name of the context as the action. > What would cause the action to not return correctly? See below for my > specific case. Thank you in advance for any help. > > This code: > > > Returns this: > > > My ActionMapping for is: >path="/ManageAgent" > type="com.crownga.actions.AgentAction" > scope="request" > name="agentForm" > input="/admin/ManageAgent.jsp" > parameter="method" > > > name="editSuccess" > path="/admin/ManageAgent.jsp" /> > name="success" > path="/ListAgents.do?method=listAll" > redirect="true" /> > name="failure" > path="/admin/ManageAgent.jsp" /> > > > > > Carl F. Hall > [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: Curious how others handle these situations..
Hubert Rabago wrote the following on 10/25/2004 11:54 AM: First, allow the editing of a player from one location only. This way, I only need to get back to that page. I 'try' to do this also. Second, if you're on the roster screen, and you want to edit the player, I'll let you do that, but in a separate window. I like this approach also and is what I decided to do for this one app (not related to nfl or rosters:). I was initially going to try to avoid the opening of extra windows, but in this case it makes life so much easier. However, when I absolutely need to support this, then the location to forward back to (ain't that an oxymoron?) gets included as an optional request parameter. If it's present, that's where I forward to after the edit. If it isn't there, I forward to the default "view" page for that data. Just to clarify, the optional parameter isn't a dynamic value that gets calculated into a view. It's a static label, so I still control which views an action forwards to, and I can still see them all in my config file. Right. The problem/ugly part is having to make sure you set up, in a seeminly unrelated action, all the stuff the action you will forward to also needs to perform its task. I suppose the difference between this and your session+mapping approach would be, you'd be duplicating info on the config, whereas I'll just have an if statement on my action. In both cases, each "edit" link/button/form would have to be aware of what it's got to do to get back control after the edit operation. Yup. I only opted for the config approach since later on if you didn't need the 'if' logic, I found it cleaner to just delete the config entry versus having to mess with the action if logic - although like I mentioned above, I'd still have to have my action aware of where it's going to next so I'd still end up having to modify the action if things changed, so the config approach doesn't buy much anyway:) Thanks for your input. I appreciated it. -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] To cut to the chase.. Imagine a hypothetical UI where you have checkboxes next to football players and by checking the boxes and hitting 'save' you would be saving a roster. Typically you'd have a FormBean to capture this information and probably a "RosterAction". Now also imagine that next to each player on the above list where you set up the roster, there is also an 'edit' button that lets you edit the player. In the application this will not be the only way you can get to edit a player so its behavior needs to be self contained (ie "PlayerAction"). The question I have is, how do you guys handle situations where you need to get 'back' to different pages depending on where the user was? For example, in the above scenario, after a user edits a player, I want the user to be forwarded "back" to the same roster selection screen with what he was working on - what he's checked - still selected. However, if maybe the user is getting to the edit a player functionality from a search screen of search results where he searched for a player to edit, I want the user returned to that screen. The only clean way sort of clean way I've found to accomplish this is to rely heavily on the use of Session. For example if the Session is used to store search results and the roster. You can have mappings that look like: If you don't use the Session above, all have to make use of fowarding back to other actions and having to set up a bucnh of parameters before doing so. The maintenance of this gets to be a pain. I'm curious of how others handle these situations. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Error handling basics
Hmmm... it looks like you *didn't* specify the input attribute on the mapping. Freddy Villalba A. wrote: Hello, I've made myself a small test application. I wanted to test error handling within the "validate" method. The problem is that I'm not being redirected to the jsp I have specified inside the "input" attribute. Instead, I'm getting a blank page (with no error messages at all inside). This is the validate method in my form: public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if ((this.getName() == null) || this.getName().trim().equals("")) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a name")); } if (errors.isEmpty()) { return null; } else { return errors; } } This is the mapping inside my struts-config.xml: I'm not using the tag (I believe it's not mandatory to use one). Am i missing something? Thanx, Freddy. P.S.: I've debugged the RequestProcessor and it seems to be stopping - without throwing an exception or anything else - when trying to execute the following line: RequestDispatcher rd = getServletContext().getRequestDispatcher(uri); and my web application's context root is "wa" (http://localhost:8080/wa/createCustomer.do) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error handling basics
Hello, I've made myself a small test application. I wanted to test error handling within the "validate" method. The problem is that I'm not being redirected to the jsp I have specified inside the "input" attribute. Instead, I'm getting a blank page (with no error messages at all inside). This is the validate method in my form: public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { ActionErrors errors = new ActionErrors(); if ((this.getName() == null) || this.getName().trim().equals("")) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("Must specify a name")); } if (errors.isEmpty()) { return null; } else { return errors; } } This is the mapping inside my struts-config.xml: I'm not using the tag (I believe it's not mandatory to use one). Am i missing something? Thanx, Freddy. P.S.: I've debugged the RequestProcessor and it seems to be stopping - without throwing an exception or anything else - when trying to execute the following line: RequestDispatcher rd = getServletContext().getRequestDispatcher(uri); and my web application's context root is "wa" (http://localhost:8080/wa/createCustomer.do) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:form doesn't return action
I don't know if this is a cut-and-paste error but you are missing a '>' in your action mapping after ' parameter="method" ' Carl F. Hall wrote: Whenever I use html:form, I only get the name of the context as the action. What would cause the action to not return correctly? See below for my specific case. Thank you in advance for any help. This code: Returns this: My ActionMapping for is: Carl F. Hall [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form doesn't return action
Whenever I use html:form, I only get the name of the context as the action. What would cause the action to not return correctly? See below for my specific case. Thank you in advance for any help. This code: Returns this: My ActionMapping for is: Carl F. Hall [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tab UI controls for struts
kjc wrote: looking for a tab UI control for use with struts. Tiles comes with a Tabbed Layout ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Curious how others handle these situations..
I personally try to avoid situations like this. There are a couple of ways I avoid it. First, allow the editing of a player from one location only. This way, I only need to get back to that page. Second, if you're on the roster screen, and you want to edit the player, I'll let you do that, but in a separate window. Perhaps the player's name doesn't even link to the edit form, but instead to a view form (or in your case, I'll have a "view" button instead of an "edit" button, though I've always gone the link route). From there you can click on Edit, make your changes, get back the view form, and close the separate window if you want. However, when I absolutely need to support this, then the location to forward back to (ain't that an oxymoron?) gets included as an optional request parameter. If it's present, that's where I forward to after the edit. If it isn't there, I forward to the default "view" page for that data. Just to clarify, the optional parameter isn't a dynamic value that gets calculated into a view. It's a static label, so I still control which views an action forwards to, and I can still see them all in my config file. I suppose the difference between this and your session+mapping approach would be, you'd be duplicating info on the config, whereas I'll just have an if statement on my action. In both cases, each "edit" link/button/form would have to be aware of what it's got to do to get back control after the edit operation. hth. -Original Message- From: Rick Reumann [mailto:[EMAIL PROTECTED] To cut to the chase.. Imagine a hypothetical UI where you have checkboxes next to football players and by checking the boxes and hitting 'save' you would be saving a roster. Typically you'd have a FormBean to capture this information and probably a "RosterAction". Now also imagine that next to each player on the above list where you set up the roster, there is also an 'edit' button that lets you edit the player. In the application this will not be the only way you can get to edit a player so its behavior needs to be self contained (ie "PlayerAction"). The question I have is, how do you guys handle situations where you need to get 'back' to different pages depending on where the user was? For example, in the above scenario, after a user edits a player, I want the user to be forwarded "back" to the same roster selection screen with what he was working on - what he's checked - still selected. However, if maybe the user is getting to the edit a player functionality from a search screen of search results where he searched for a player to edit, I want the user returned to that screen. The only clean way sort of clean way I've found to accomplish this is to rely heavily on the use of Session. For example if the Session is used to store search results and the roster. You can have mappings that look like: If you don't use the Session above, all have to make use of fowarding back to other actions and having to set up a bucnh of parameters before doing so. The maintenance of this gets to be a pain. I'm curious of how others handle these situations. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
requiredif combined with other validation rules
hi. i'm using struts 1.1 and have a question about combining requiredif with other validation rules. i have field[0] country fieldTest[0] EQUAL fieldValue[0] 840 mask ${uszipmask} if a user chooses a country other than 840 (usa) and leaves the zip blank, then the form passes validation. however, if he chooses a country other than 840 and enters something in the zip field then the mask is applied to that value. i would like the mask rule to be bypassed also if the country isn't 840. is this possible? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: tab UI controls for struts
I had a look for such things a few weeks ago. My requirement was for a server side implementation - i.e. one that didn't execute the content of hidden tags. I couldn't find anything that met that requirement. I did find a pretty cool looking client side implementation at http://www.pintexx.com/ I've implemented my own tab control as a bunch of custom tags. There is no inherent dependancy on Struts - the state is maintained in hidden html fields & a change of tab is indicated via request parameters. I'm not in a position to share any of this code I'm afraid, but I'm more than happy to discuss the design etc. Paul > -Original Message- > From: kjc [mailto:[EMAIL PROTECTED] > Sent: Monday, October 25, 2004 4:36 PM > To: [EMAIL PROTECTED] > Subject: tab UI controls for struts > > > looking for a tab UI control for use with struts. > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: tab UI controls for struts
Take a look at Struts Menu http://struts-menu.sourceforge.net/ On Mon, 25 Oct 2004 09:36:04 -0600, kjc <[EMAIL PROTECTED]> wrote: > looking for a tab UI control for use with struts. > > - > 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: html table full screen
andy wix wrote: My Tiles layout page sets 'the daddy' table to be width and height 100% with cellspacing="0" and cellpadding="0", and yet when the page displays there is a border approx. 10 pixels wide between the table and the edge of the browser window. DO browsers add this spacing? Thats the body margin; it can be removed with CSS. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
OT: html table full screen
Hi, My Tiles layout page sets 'the daddy' table to be width and height 100% with cellspacing="0" and cellpadding="0", and yet when the page displays there is a border approx. 10 pixels wide between the table and the edge of the browser window. DO browsers add this spacing? Regards, Andy _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Writing form field values out
If the form bean is named "myform", then you could use: Crag On Mon, 25 Oct 2004 15:11:19 +, Mark Benussi <[EMAIL PROTECTED]> wrote: > I have a requirement to write out the value of a form field in aother part > of the page (But within the form). > > Can someone supply the snippet of code. Let us say the field is called xyz. > > - > 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]
tab UI controls for struts
looking for a tab UI control for use with struts. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Curious how others handle these situations..
To cut to the chase.. Imagine a hypothetical UI where you have checkboxes next to football players and by checking the boxes and hitting 'save' you would be saving a roster. Typically you'd have a FormBean to capture this information and probably a "RosterAction". Now also imagine that next to each player on the above list where you set up the roster, there is also an 'edit' button that lets you edit the player. In the application this will not be the only way you can get to edit a player so its behavior needs to be self contained (ie "PlayerAction"). The question I have is, how do you guys handle situations where you need to get 'back' to different pages depending on where the user was? For example, in the above scenario, after a user edits a player, I want the user to be forwarded "back" to the same roster selection screen with what he was working on - what he's checked - still selected. However, if maybe the user is getting to the edit a player functionality from a search screen of search results where he searched for a player to edit, I want the user returned to that screen. The only clean way sort of clean way I've found to accomplish this is to rely heavily on the use of Session. For example if the Session is used to store search results and the roster. You can have mappings that look like: If you don't use the Session above, all have to make use of fowarding back to other actions and having to set up a bucnh of parameters before doing so. The maintenance of this gets to be a pain. I'm curious of how others handle these situations. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: file validation best practice - Thanks everyone
At 7:24 AM -0700 10/25/04, struts lover wrote: Hello, Thanks everyone for your interest and replies. Thanks very much. I had one more question. If I use getContentType() of FormFile, does it give the same results on different operating systems that is if the client is using different operating systems. Yes, the client determines by its own mechanisms what MIME type to send. For a specific example, MSIE insists on labeling all JPEG images as "image/pjpeg". This is annoying because we use a third-party application which explodes when it tries to process progressive JPEGs. We've had to institute a process which "resaves" all JPEGs explicitly as not-progressive. It would be nice if MSIE would tell the truth, so we could only use that process when we really need it, although I suppose given how badly the third-party app response to PJPEGs, it's probably safest that we do this anyway. Does the change in server OS affects the getContentType() result. No, it shouldn't, because it simply accepts whatever is sent by the client. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana
Writing form field values out
I have a requirement to write out the value of a form field in aother part of the page (But within the form). Can someone supply the snippet of code. Let us say the field is called xyz. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
erp backup
erp backup Tiles OK. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Object size/memory usage
Let's say I have two object public calss Object1{ private name; private id; private depetId; } public calss Object2{ private name; private id; private depetId; private country; private jobFamily; private isActive; . (there are another 100 attributes) } Then I create Object1 obj1= new Object1(); and set all attributes (name, id, depetId) of this object. Object2 obj2 = new Object2(); and then set the first three attributes(name, id, depetId). My question is that is obj1 and obj2 of the same size or usage of memory? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: file validation best practice - Thanks everyone
Hello, Thanks everyone for your interest and replies. Thanks very much. I had one more question. If I use getContentType() of FormFile, does it give the same results on different operating systems that is if the client is using different operating systems. Does the change in server OS affects the getContentType() result. Thanks once again. --- Craig McClanahan <[EMAIL PROTECTED]> wrote: > If your server is a Unix platform, one thing you > could do is run the > shell command "file" against the uploaded file, and > take a look at the > result. This tool ignores any extension on the > filename, and examines > the content of the file itself against signature > patterns it knows > about. > > Craig > > > > On Sun, 24 Oct 2004 22:30:43 -0400, Bill Siggelkow > <[EMAIL PROTECTED]> wrote: > > I know of no way to deterministically discover > what type of file the > > user sent. There is nothing to prevent a user from > taking a .exe file > > and changing the extension to .txt or anything > else ... others may have > > a better idea ... > > > > > > > > struts lover wrote: > > > > > Thanks Bill. > > > I had another question. What if the user has > some .exe > > > file with .doc extension. I mean > somefile.exe.doc. > > > How do I check the valid file type with the > extension. > > > > > > Thanks once again. > > > > > > --- Bill Siggelkow <[EMAIL PROTECTED]> > wrote: > > > > > > > > >>U can set the accepted mime types on the input > tag; > > >>however, the browser > > >>may not do anything with this information; so in > > >>your ActionForm, I > > >>suggest you validate the type by checking the > > >>extension of the received > > >>file name. > > >> > > >>struts lover wrote: > > >> > > >> > > >>>Hi Everyone, > > >>>I wanted to know what is the best practice for > > >> > > >>file > > >> > > >>>type validation. I want the user to allow to > > >> > > >>upload > > >> > > >>>only certain type of files and disallow all > other > > >>>types. > > >>>I am using Struts FormFile. > > >>> > > >>>Any help would be appreciated. > > >>>Thanks. > > >>> > > >>> > > >>> > > >>>___ > > >>>Do you Yahoo!? > > >>>Declare Yourself - Register online to vote > today! > > >>>http://vote.yahoo.com > > >> > > >> > > >> > > > > - > > > > > >>To unsubscribe, e-mail: > > >>[EMAIL PROTECTED] > > >>For additional commands, e-mail: > > >>[EMAIL PROTECTED] > > >> > > >> > > > > > > > > > > > > > > > > > > ___ > > > Do you Yahoo!? > > > Declare Yourself - Register online to vote > today! > > > http://vote.yahoo.com > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: "refreshing" server side infromation
Thanks for your answer, I did it just with the refresh tag, just some questions: what's de difference between using the hidden Iframe or not?, Is there some way to hide the browser reload "signs" when refreshing? tito El miÃ, 06 de 10 de 2004 a las 11:23, James Neville escribiÃ: > Tito Eritja wrote: > > >Would be an > >applet a good solution?, is there another way to solve it? > > > > You could stick a hidden Iframe on the page that uses the refresh tag in > the page header. > > > > This page checks for changes and reloads the main page if required. > > I'd stay away from applets ;) > > Cheers, > James > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Hosting Companies
I use jvds.com. UML style hosting, so you can install anything you want. You basically have root access to your own virtual Linux machine. Joe Hertz wrote: I dont see Struts supporting hosting companies on the wiki. It used to be on the site before the resources link pointed you to the wiki IARC. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts-Chain] how to use another chain for preprocessing?
At 4:26 PM +0900 10/25/04, Bill Keese wrote: Craig McClanahan wrote: * Regarding chaining of actions themselves, if you are using the standard request processing chain that remains as bad an idea as it has always been in Struts, and I don't see any reason to make it easier with chaining than it is today. Hi Craig. I was hoping you could explain 1) how people typically chain actions in struts 2) why it is a bad idea I have some ideas for answers to both questions but I'd like to hear what you think. Here's a page in the Wiki about this eternal question: http://wiki.apache.org/struts/ActionChaining To chain actions, you simply return a non-redirect ActionForward which points to a Struts action path. This is chaining (where a redirect isn't) because it results in the ActionServlet triggering a second "run" through the RequestProcessor's processing flow. This can have some unexpected side effects, which is one reason it's not considered "supported behavior". Also, as Ted notes on the references Wiki pages, when people chain actions, it is often (though not always) because they haven't got a clean controller architecture. I notice that the email from Craig included in that page is over two years old and heavily references the transition from Struts 1.0 to Struts 1.1; is that still useful this far on? I'm not sure who the "I" is in the lead-in to that page is. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place." - Carlos Santana
Re: Map Backed Form and JavaScript
document.forms[0]['dto(name)'].value Hariharan V wrote: Hi, I am making use of Map backed Action form Lets say I have named the textbox field as follows How can I access the text field value from JavaScript for instance I can't do something like this. document.forms[0].dto(name).value; (but this will give a JS error) any workaround or can we use any escape sequence in JS -Hari - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request question
If your trash-can button is using a link, you need to encode the request parameters into the link when you generate the JSP page. If your trash-can button is submitting a form, you need to create elements in your JSP page for each request parameter. I would recommend the latter approach, because it's the only way you can use the POST method to submit your request, and that's the recommended approach for any operations that attempt to modify the data in the system. -- Jeff Vinicius Carvalho wrote: Hi there! This kinda off topic, but I'm confused with that. I have this flow on my app: User search -> content display -> remove Let me get in some finer details. The user enters a criteria to filter the number of items displayed, on the next screen those items are shown with a trash icon, representing the delete action. The user deletes an item and then goes back to the screen with the items. The issue here, is that I must preserve the criteria. I'd like to avoid to use session, is there any better option? I mean, in my jsp I have access to the criteria that was put in request, but how to propagate it to the delete action and then to the jsp again? request.setAttribute(request.getAttribute("criteria"),"criteria"); seems pretty odd to me. Thanks all Viniucius Vinicius - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Shale
+1. Excellent read. It certainly gives one insight into the future web application development. robert > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Monday, October 25, 2004 1:09 AM > To: Struts Users Mailing List > Subject: [OT] Shale > > > For those of you who do not get the wiki changes, I would recommend that > you look at the following addition by Craig. > > http://wiki.apache.org/struts/StrutsShale > > Very exciting stuff. > > Michael McGrady > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [html:select/optionsCollection] I don't get it! :( [shame on me!]
Michael, Many thanks for your help. In fact, I added a Vector to a Vector with the method... add, not addAll! Fri, 22 Oct 2004 15:46:22 +0200, "Albrecht, Michael" <[EMAIL PROTECTED]> wrote: > Hi Arnaud! > > The following lines show you an example for optionsCollection - tag: > > > label="text" /> > > > The bean searchForm has got an attribute of type java.util.List called durations (of > course there`s a public method getDurations()). > > A duration-object /-item of this list has got two attributes called days and text > (that means getDays() and getText()) which are both of type String. > So that is why I can use optionsCollection, because label and value is part of the > same bean. > > The Getters have to be created because they will be used by BeanUtils framework. > > The property duration of the html:select - tag is an attribute of the form > associated with the Struts action, which is called by submit. > This form bean has nothing to do with searchForm. > > Hopefully this helps you out of your chaos. > > Michael > > -Ursprüngliche Nachricht- > Von: Arnaud Vandyck [mailto:[EMAIL PROTECTED] > Gesendet: Freitag, 22. Oktober 2004 15:29 > An: Struts Users Mailing List > Betreff: [html:select/optionsCollection] I don't get it! :( > > > Hi! > > It's two days now I'm fighting with . I don't understand how I have to > build my bean and how I have to pass the arguments to the tag. > > Has my bean to be a Collection? Has it to have an iterator() method? How to write > the getters and setters? > > Many thanks for your help! > > -- > Arnaud Vandyck > http://fosdem.org/ > Free and Open Source Developers' European Meeting > February 26-27 2005, > Bruxelles, Belgium > > - > 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] > > > -- Arnaud Vandyck http://fosdem.org/ Free and Open Source Developers' European Meeting February 26-27 2005, Bruxelles, Belgium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
request question
Hi there! This kinda off topic, but I'm confused with that. I have this flow on my app: User search -> content display -> remove Let me get in some finer details. The user enters a criteria to filter the number of items displayed, on the next screen those items are shown with a trash icon, representing the delete action. The user deletes an item and then goes back to the screen with the items. The issue here, is that I must preserve the criteria. I'd like to avoid to use session, is there any better option? I mean, in my jsp I have access to the criteria that was put in request, but how to propagate it to the delete action and then to the jsp again? request.setAttribute(request.getAttribute("criteria"),"criteria"); seems pretty odd to me. Thanks all Viniucius Vinicius - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Map Backed Form and JavaScript
Hi, I am making use of Map backed Action form Lets say I have named the textbox field as follows How can I access the text field value from JavaScript for instance I can't do something like this. document.forms[0].dto(name).value; (but this will give a JS error) any workaround or can we use any escape sequence in JS -Hari - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem in Locating a properties File (Not application.properties)
Caroline, You need to use getResourceAsStream() method from ServletConfig class. request.getSession().getServletContext().getResourceAsStream("/filename.properties"); This will return you an InputStream that you can pass to Properties.loadProperties() and make it work. The "/" represents the context root. Nitin --- Caroline Jen <[EMAIL PROTECTED]> wrote: > The application.properties file in my web > application > works OKay. > > I have another file called > storageDirectory.properties, which has one line: > > outputFile = > C:\\jakarta-tomcat-5.0.27\\webapps\\AppName\\var\\ > > I set my classpath to > C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\src\java > > One of my class in the > C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\src\java\org\OrganizationName\content > directory tries to read this > storageDirectory.properties file: > > final String PROPFILE = > "storageDirectory.properties"; > Properties oProp = null; > > FileInputStream fis = new FileInputStream( PROPFILE > ); > oProp = new Properties(); > oProp.load ( fis ); > > I put this storageDirectory.properties in the > C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\src\java > directory. > > I then put this storageDirectory.properties in the > C:\jakarta-tomcat-5.0.27\webapps\AppName\WEB-INF\src\java\resources > directory. > > No matter where I put this properties file, I get > this > runtime error message: > java.io.FileNotFoundException: > storageDirectory.properties (The system cannot find > the file specified) > > And it points to this statement: > FileInputStream fis = new FileInputStream( PROPFILE > ); > > > > ___ > Do you Yahoo!? > Declare Yourself - Register online to vote today! > http://vote.yahoo.com > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ___ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Struts-Chain] how to use another chain for preprocessing?
Craig McClanahan wrote: * Regarding chaining of actions themselves, if you are using the standard request processing chain that remains as bad an idea as it has always been in Struts, and I don't see any reason to make it easier with chaining than it is today. Hi Craig. I was hoping you could explain 1) how people typically chain actions in struts 2) why it is a bad idea I have some ideas for answers to both questions but I'd like to hear what you think. Thanks, Bill The code that is in the repository now has focused on providing a chain implementation that is fundamentally backwards compatible with existing Struts 1.1/1.2 functionality. As such, it emulates the current RequestProcessor architecture by passng all requests through a single commonly configured pipeline (which can, of course, be customized). Going beyond strict backwards compatibility, there's lots of options: * A chain can already invoke another chain using the generic LookupCommand capability. The "other" chain's name can be determined either literally (via the "name" property) or indirectly (via the "nameKey" property, naming a context property where some other processing logic has stored the name of the chain to be executed). * Given this, it would be trivial, for example, to create a chain equivalent to the standard DispatchAction, which based the name of the chain to run on some request parameter, or other incomding characteristic on the request. In the "servlet-standard" chain, this technique is used to execute a user-defined preprocess chain if there is one, ignoring it otherwise. * Alternatively, it would be possible to set things up so that the name of the action implicitly selects a correspondingly named chain (if there is one); defaulting to the standard chain if there is nothing special. That way you could customize the processing of individual actions without having to affect all of them. * Regarding chaining of actions themselves, if you are using the standard request processing chain that remains as bad an idea as it has always been in Struts, and I don't see any reason to make it easier with chaining than it is today. Instead, a different approach is likely to be better -- for example, building a chain that forwards to a view named "foo" could automatically look up a setup chain (specific to that view) and execute it if it's there. This would likely eliminate many occurrences of the "setup action --> view --> process action" design that you see in lots of Struts code. What a chain does is totally up to who designs the chain. Once you free yourself from a requirement to be backwards compatible (leaving the existing servlet-standard chain there for people that *do* want that), there's a lot of room to innovate. So, the answer to nearly all of yor questions is "yes, you can do that if you want to." Craig On Fri, 22 Oct 2004 20:23:28 -0400, David G. Friedman <[EMAIL PROTECTED]> wrote: I'm curious about Struts-Chain and have read through the 1.2.4 source on it plus the 1.3 SVN repository. I don't see anything suggesting how to make my action chain itself to another action in the struts-config.xml example. Nor do I see anything suggesting how to have an action be processed by a chain other than the default chain. Is struts-chain supposed to be as one chain per web.xml pattern matching? Are the chains supposed to do that and use a common struts configuration object? (I.e. Just /do/whatever invokes chain a but mapping /dothis/whatever3 invokes a different chain? Thanks for any help. Regards, David the Curious ([EMAIL PROTECTED]) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: : pre-populating fields from the Action java code
Thanks. Yes, I can reference the bean name from every or other element inside of the . But if there are lots of fields, it would be nicer to only write the bean name once, in the tag. Luis Gervaso wrote: You can use 3 differents FlightBean and then populate the *value attribute* in each When you click only one form submit is sent Luis Gervaso On Fri, 22 Oct 2004 15:28:16 +0900, Bill Keese <[EMAIL PROTECTED]> wrote: I have a question about pre-populating the fields of a form you display in the browser. To pre-populate fields, the Action saves a Form bean in the context via request.setAttribute("inputForm", inputForm), and tag looks up the form bean. determines the form bean's name automatically based on the specified action and the settings in struts-config.xml. But, what if you wanted a web page with multiple forms all pointing at the same action? For example, an airline ticket website might display 10 possible flights and have a button to book each flight. All the buttons point at the same bookFlight action, but the flight number attribute is different. In other words, how do I implement the code below without using the "name" (or beanName) attribute: MyAction.java: request.setAttribute("inputForm1", new InputForm("$499", "flight 31")); request.setAttribute("inputForm2", new InputForm("$599", "flight 32")); request.setAttribute("inputForm3", new InputForm("$699", "flight 33")); MyPage.jsp: Bill - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I set values to message parameters by using bean:message tag?
Thank you very much. Ssorry for my poor english. Yufan Shi We are Online! http://www.ivanshi.com/blog/ -Original Message- From: Greg Ludington [mailto:[EMAIL PROTECTED] Sent: Monday, October 25, 2004 10:18 AM To: Struts Users Mailing List Subject: Re: How can I set values to message parameters by using bean:message tag? > Hi all, > I am wondering if there is a way to set values to message paramerts by > using bean:message, for example, I have a message entry in my > application.properties file like this:Welcome, {0} Unless I am misunderstanding what you are looking for, that is what the arg0-arg4 attributes are for, to insert up to 5 parametric replacements. In case I have goofed, check the docs at: http://struts.apache.org/userGuide/struts-bean.html#message If you prefer to use JSTL over struts tags when possible, the JSTL equivalent is the tag. hth, Greg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I set values to message parameters by using bean:message tag?
Thank you very much. Ssorry for my poor english. Yufan Shi We are Online! http://www.ivanshi.com/blog/ -Original Message- From: Greg Ludington [mailto:[EMAIL PROTECTED] Sent: Monday, October 25, 2004 10:18 AM To: Struts Users Mailing List Subject: Re: How can I set values to message parameters by using bean:message tag? > Hi all, > I am wondering if there is a way to set values to message paramerts by > using bean:message, for example, I have a message entry in my > application.properties file like this:Welcome, {0} Unless I am misunderstanding what you are looking for, that is what the arg0-arg4 attributes are for, to insert up to 5 parametric replacements. In case I have goofed, check the docs at: http://struts.apache.org/userGuide/struts-bean.html#message If you prefer to use JSTL over struts tags when possible, the JSTL equivalent is the tag. hth, Greg - 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]