drop down list
Hi all In a List box if particular option has to be selected(say the 3rd one in a list of 5). Normally selected word has to be placed inside the relevant option tag option selected . In struts the very first option shows as the selected one on the browser. But if you need to show the 3rd option as slelected in the list how do we do that in struts? thanks a lot in advance Mahesh -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: drop down list
On Saturday, January 19, 2002, at 09:58 AM, Mahesh Agarwal wrote: Hi all In a List box if particular option has to be selected(say the 3rd one in a list of 5). Normally selected word has to be placed inside the relevant option tag option selected . In struts the very first option shows as the selected one on the browser. But if you need to show the 3rd option as slelected in the list how do we do that in struts? thanks a lot in advance Mahesh If you use the struts-html tags, and use a form bean which is setup with the correct defaults, struts does this automagically. So for example, say the drop-down list is a choice between a, b and c, and the property is called 'choice', and you want c to be the default, then you just make sure that the default value of choice in your form bean is c. If you need me to clarify further, email me and I'll send you some code to show what I mean. Yours, Peter -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Velocity-Tools / Struts
Will, I just downloaded the .war as well and tested it on a Tomcat 4.01 installation. Everything works flawlessly. The class that it's complaining about is included in WEB-INF/lib/velocity-tools-view-0.3.jar What is special about WebLogic 6.1SP2 that it cannot find this class? Would it find the class if it's not contained in a jar? Maybe try to unwrap velocity-tools-view-0.3.jar below WEB-INF/classes/ If anything about web development is difficult then it's these deployment issues... Gabe Will Spies/Towers Perrin wrote: I did a quick deployment of your war and got this message from WebLogic 6.1SP2 [WebAppServletContext(7817190,velstruts,/velstruts)] Error loading servlet: velocity java.lang.ClassNotFoundException: org.apache.velocity.tools.view.servlet.VelocityViewServlet at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:179) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:65) at java.lang.ClassLoader.loadClass(ClassLoader.java:297) at java.lang.ClassLoader.loadClass(ClassLoader.java:253) at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43) at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:583) at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.java:2221) at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.java:2165) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:892) at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:815) at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:428) at weblogic.j2ee.WebAppComponent.deploy(WebAppComponent.java:74) at weblogic.j2ee.Application.addComponent(Application.java:163) at weblogic.j2ee.J2EEService.addDeployment(J2EEService.java:117) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:329) at weblogic.management.mbeans.custom.DeploymentTarget.addDeployment(DeploymentTarget.java:144) at weblogic.management.mbeans.custom.WebServer.addWebDeployment(WebServer.java:76) at java.lang.reflect.Method.invoke(Native Method) at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636) at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621) at weblogic.management.internal.ConfigurationMBeanImpl.invoke(ConfigurationMBeanImpl.java:359) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555) at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468) at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209) at $Proxy37.addWebDeployment(Unknown Source) at ___ Will Spies Towers Perrin Phone: (215)246-7145 e-mail: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Ted Husted cc: (bcc: Will Spies/Towers Perrin) husted@apache Subject: Velocity-Tools / Struts .org 01/18/02 09:46 AM Please respond to Struts Users Mailing List Will Spies/Towers Perrin wrote: And Velocity can access the Struts controller too :) is this documented anywhere? Is this just in development now or is it part of their release? It hasn't made it into the release yet, but the code is already working and seems mature. It's just a matter of making the Struts elements available as standard objects that Velocity can see. Really ~very~ cool. You can download the sample application WAR here. Very much worth a look. http://husted.com/struts/resources/velstruts.zip I'll be working on adding more documentation for this, and other contributions like the Commons-Validator and Tiles to the Struts User Guide. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Building Java web applications with Struts. -- Tel +1 585 737-3463. -- Web http://www.husted.com/struts/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Gabriel Sidler Software Engineer, Eivycom GmbH, Zurich, Switzerland -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re:Re: Problem using rational pure coverage in struts
Hi dion, Thank u very much for ur reply. JSP using ANY taglib is not working. we have our own taglibs in our project. When I tried using one of the taglib in the jsp it is giving the same errors which I had mentioned in my earlier mail. Cud u pl.. suggest me Thanks in advance, YUg -- From: dion[SMTP:[EMAIL PROTECTED]] Reply To: Struts Users Mailing List Sent: Saturday, January 19, 2002 7:07 AM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re: Problem using rational pure coverage in struts yugandhar Reddy wrote: Hi, I am facing a serious problem in using rational pure coverage in struts When i run the code coverage(Pure Coverage of Rational) tool for the jsp which does not use Struts, the jsp is getting executed. But When i run the code coverage tool for the jsp using Struts my jsp is not getting executed. It is showing some errors like java.exe - Application error The instruction at 0x77fc9e2f referenced memory at 0x0eb97fe5. The memory could not be read. Click ok to terminate the application Click Cancel to debug the application and my weblogic server says # An EXCEPTION_ACCESS_VIOLATION exception has been detected in native code outsi de the VM. # Program counter=0x77fc9ba2 # # Problematic Thread: prio=5 tid=0x76a8d30 nid=0x540 runnable # Why is this ??? JSP with out struts executes and Jsp with struts does not execute. Is it like struts does not support code coverage? Ur help in this is highly appreciated Do any other JSP using ANY taglib work? -- dIon Gillard, Multitask Consulting http://www.multitask.com.au/developers -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] - Do You Yahoo!? Send FREE video emails in Yahoo! Mail.
Design question on loading form data
Hello! If i want to fill a form with data (from, say a database) before showing it to the user: Can this be done in reset() method of the form, or should it be in the perform() method of the action class? I think that doing it in the reset() method produces the cleanest code. This can be done in quite a dynamic way too, since the reset method has access to the http request and the mapping. It can use these to get info on what (if any) item to load from the database. Short example: --- I have an action called editOrder and a form called orderForm. In the reset method of the form: reset(mapping,request) { // check mapping, the form might be used by other actions // that don't want our little featue if (mapping.getType.equals(editOrder) { int orderId = request.getInt(orderId); OrderData order = db.loadOrder(orderId); this.orderName = order.getName(); this.orderSize = order.getSize(); // .. and so on } } --- Any suggestions or thoughts around this way of doing things? Looks nice to me, but I'd sure like to know if there is something nasty that I've missed here. Regards, Mattias Norlander -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Is bean:include supposed to JSP process the page?
I replaced the following (which is working as expected): jsp:include page=%= /private/component/detail/memberComponent + bean.getComponent().getTypeId() + ViewContent.html % / With: bean:include id=detail page=%= /private/component/detail/memberComponent + bean.getComponent().getTypeId() + ViewContent.html % / bean:write name=detail/ However, the output was NOT processed by the .JSP engine. I have my .html extension mapped for processing by the .JSP engine. Is this working correctly? -AP_ www: http://www.alexparansky.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Vik's book on Struts (basebeans book)
Don't waste your money. Get Professional JSP Site Design ISBN: 1861005512 It is *significantly* better. -Original Message- From: Mark Galbreath [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 19, 2002 7:29 AM To: Struts Users Mailing List Subject: Re: Vik's book on Struts (basebeans book) $60 is quite a piece of change to pay for a book that's already outdated!! Mark - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Saturday, January 19, 2002 12:18 AM Subject: RE: Vik's book on Struts (basebeans book) I think you can use either version. More work is necessary if you download struts 1.0 because you will eventually need to bring down the commons libraries. (used by Tiles and used by Validation framework) I am not a struts guru, but messaging is different in struts 1.1 and this does not seem to be covered. Sandeep --- Mark Galbreath [EMAIL PROTECTED] wrote: What version of Struts does it cover? Mark -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED]] Sent: Friday, January 18, 2002 9:19 AM To: Struts Mailing List Subject: Vik's book on Struts (basebeans book) I just received Vik's book on Struts. It may be different than what you expect, but in my opinion it is original and will be useful. It is kinda like lab work. For example -- the first chapter is called a warm-up and asks the user some questions and asks the user to set up tomcat PostGreSQL etc. This is useful for me. For example -- I know java, tomcat, struts to a certain degree and the warmup makes sure I know a certain level before continuuing. However database stuff I have never had time for and so it became clear that in order to continue I would have to download some stuff and do some reading etc. It seems that as the chapters progress you get to learn a little bit more of the puzzle. I think it comes down to how you learn. I learn through application and not much through listening. I am not sure if this is true of everyone. So far I am impressed by this book and plan on using it to further my knowledge in areas I consider weak. It is different than every book out there that I know of however and so make take some adjustment. This is not an endorsement, just my 2 cents. Sandeep __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Language Alphabet Set
That is what I want to know... --- John Hunt [EMAIL PROTECTED] wrote: Isnt there a way to get the alphabet of a language? --- John Hunt [EMAIL PROTECTED] wrote: Hi I want to get the alphabet of a language based on the locale. How can I do that? I have to display an index structure based on the locale. So I need alphabet of the particular locale which comes in the request. Any help regarding this would be highly appreciated. Thanks Junta __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Design Help Needed - Routing to common transformer JSP
I've figured out a pretty slick (I think) way to use XSL have one page that changes the look and feel of my entire application. Basically, I put all my XML JSP's in a pages directory - and all they really contain is title, heading, and form elements (populated by bean:write and html:form). All layout is controlled by a CSS stylesheet (I'm only supporting standards-compliant browsers - and client agrees ;). So my rough solution at this point is to route all requests for JSP's to a JSP (with the same name in the / directory). So I have a JSP Transformer for each JSP XML page. I'd like to just have one page that does the transformation. However, there's GOT to be an easier way. You would think it would be easy to create a URL-mapping for this - or something like that. I would like it would be easy to create a url-pattern of *.jsx that would route to a htmlTransform.jsp page. Is this the best way? I really like the idea of using JSP's to get messages and form values - seems pretty easy. If there is a way of using a servlet in place of the htmlTransform.jsp - that might be a good idea... Thanks, Matt web.xml - !-- XSLT Tranformer -- servlet servlet-namexslt/servlet-name jsp-file/htmlTransform.jsp/jsp-file /servlet !-- XSLT Mapping -- servlet-mapping servlet-namexslt/servlet-name url-pattern*.jsx/url-patter /servlet-mapping htmlTransform.jsp -- %@ page language=java % %@ taglib uri=/WEB-INF/c.tld prefix=c % %@ taglib uri=/WEB-INF/x.tld prefix=x % % String xmlJsp = request.getServletPath(); xmlJsp = /pages + xmlJsp.substring(0,xmlJsp.indexOf(.)) + .jsp; System.out.println(xmlJsp = + xmlJsp); % c:import url=%=xmlJsp% var=xml/ c:import url=/styles/xsl-xhtml.jsp var=xslt/ x:transform source=$xml xslt=$xslt/ __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design Help Needed - Routing to common transformer JSP
Hmmm, doesn't work like I'd hoped: java.lang.IllegalArgumentException: Cannot URL decode request path /%=xmlJsp% --- Matt Raible [EMAIL PROTECTED] wrote: I've figured out a pretty slick (I think) way to use XSL have one page that changes the look and feel of my entire application. Basically, I put all my XML JSP's in a pages directory - and all they really contain is title, heading, and form elements (populated by bean:write and html:form). All layout is controlled by a CSS stylesheet (I'm only supporting standards-compliant browsers - and client agrees ;). So my rough solution at this point is to route all requests for JSP's to a JSP (with the same name in the / directory). So I have a JSP Transformer for each JSP XML page. I'd like to just have one page that does the transformation. However, there's GOT to be an easier way. You would think it would be easy to create a URL-mapping for this - or something like that. I would like it would be easy to create a url-pattern of *.jsx that would route to a htmlTransform.jsp page. Is this the best way? I really like the idea of using JSP's to get messages and form values - seems pretty easy. If there is a way of using a servlet in place of the htmlTransform.jsp - that might be a good idea... Thanks, Matt web.xml - !-- XSLT Tranformer -- servlet servlet-namexslt/servlet-name jsp-file/htmlTransform.jsp/jsp-file /servlet !-- XSLT Mapping -- servlet-mapping servlet-namexslt/servlet-name url-pattern*.jsx/url-patter /servlet-mapping htmlTransform.jsp -- %@ page language=java % %@ taglib uri=/WEB-INF/c.tld prefix=c % %@ taglib uri=/WEB-INF/x.tld prefix=x % % String xmlJsp = request.getServletPath(); xmlJsp = /pages + xmlJsp.substring(0,xmlJsp.indexOf(.)) + .jsp; System.out.println(xmlJsp = + xmlJsp); % c:import url=%=xmlJsp% var=xml/ c:import url=/styles/xsl-xhtml.jsp var=xslt/ x:transform source=$xml xslt=$xslt/ __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Routing to common transformer JSP - Solution w/ Bug
I found the following code to work, ugly as it it. However, the bug I'm experiencing now is that the page loads (and transforms) but the loading progress bar at the bottom of the page continues for a good 30 seconds after the page loads (both in IE and Netscape 6). Any ideas? % String xmlJsp = request.getServletPath(); xmlJsp = /pages + xmlJsp.substring(0,xmlJsp.indexOf(.)) + .jsp; % c:set var=xmlPath scope=page %=xmlJsp% /c:set c:import url=$xmlPath var=xml/ c:import url=/styles/xsl-xhtml.jsp var=xslt/ x:transform source=$xml xslt=$xslt/ --- Matt Raible [EMAIL PROTECTED] wrote: Hmmm, doesn't work like I'd hoped: java.lang.IllegalArgumentException: Cannot URL decode request path /%=xmlJsp% --- Matt Raible [EMAIL PROTECTED] wrote: I've figured out a pretty slick (I think) way to use XSL have one page that changes the look and feel of my entire application. Basically, I put all my XML JSP's in a pages directory - and all they really contain is title, heading, and form elements (populated by bean:write and html:form). All layout is controlled by a CSS stylesheet (I'm only supporting standards-compliant browsers - and client agrees ;). So my rough solution at this point is to route all requests for JSP's to a JSP (with the same name in the / directory). So I have a JSP Transformer for each JSP XML page. I'd like to just have one page that does the transformation. However, there's GOT to be an easier way. You would think it would be easy to create a URL-mapping for this - or something like that. I would like it would be easy to create a url-pattern of *.jsx that would route to a htmlTransform.jsp page. Is this the best way? I really like the idea of using JSP's to get messages and form values - seems pretty easy. If there is a way of using a servlet in place of the htmlTransform.jsp - that might be a good idea... Thanks, Matt web.xml - !-- XSLT Tranformer -- servlet servlet-namexslt/servlet-name jsp-file/htmlTransform.jsp/jsp-file /servlet !-- XSLT Mapping -- servlet-mapping servlet-namexslt/servlet-name url-pattern*.jsx/url-patter /servlet-mapping htmlTransform.jsp -- %@ page language=java % %@ taglib uri=/WEB-INF/c.tld prefix=c % %@ taglib uri=/WEB-INF/x.tld prefix=x % % String xmlJsp = request.getServletPath(); xmlJsp = /pages + xmlJsp.substring(0,xmlJsp.indexOf(.)) + .jsp; System.out.println(xmlJsp = + xmlJsp); % c:import url=%=xmlJsp% var=xml/ c:import url=/styles/xsl-xhtml.jsp var=xslt/ x:transform source=$xml xslt=$xslt/ __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
struts upload is broken
Hello there, after lurking for a while I tried to install Struts on tomcat 4.1 nightly build, but it seems that , among examples, struts-upload is broken. it throws following exception : javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:735) at org.apache.struts.util.RequestUtils.message(RequestUtils.java:699) at org.apache.struts.taglib.html.BaseHandlerTag.message(BaseHandlerTag.java:568) at org.apache.struts.taglib.html.BaseHandlerTag.prepareStyles(BaseHandlerTag.java:623) at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:200) at _upload__jsp._jspService(/struts-upload/upload.jsp:22) at com.caucho.jsp.JavaPage.service(JavaPage.java:74) at com.caucho.jsp.Page.subservice(Page.java:485) at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:176) at com.caucho.server.http.Invocation.service(Invocation.java:278) at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:129) at com.caucho.server.http.ServletServer.serviceTop(ServletServer.java:847) at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:213) at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158) at com.caucho.server.TcpConnection.run(TcpConnection.java:140) at java.lang.Thread.run(Thread.java:539) -- Best regards, corrado mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Problem using rational pure coverage in struts
yugandhar Reddy wrote: Hi dion, Thank u very much for ur reply. JSP using ANY taglib is not working. we have our own taglibs in our project. When I tried using one of the taglib in the jsp it is giving the same errors which I had mentioned in my earlier mail. Cud u pl.. suggest me Thanks in advance, YUg --- This would appear to be a bug in Rational's product. I don't think there's much we can do here to help you other than suggest you contact Rational's support services, newsgroups, jRoundup.com (their java portal) and search Google -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
html:messages is missing from struts 1.01
I've been using the html:messages for awhile now and I just recently updated to struts version 1.01 and the tag is no longer work. I hate to go back to using html:errors tag and adding the li to the message. Can you guys tell me what are the alternatives? html:messages id=message header=errors.header footer=errors.footer li class=errortextbean:write name=message//li /html:messages __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Adding parameters to forward action during create...
In a certain create action I create a new object, and want to forward to the object's EditForm. The EditForm expects the ?objectId=value parameter be set on the request. Currently, I wrote the following code in my create action to augment the current action with the ?componentId=NNN parameter: ActionForward newAction = new ActionForward(); newAction.setPath( currentAction.getPath()+?componentId=+componentValue.getComponentId() ); return newAction; This works, but I don't like the way I needed to hardcode this. Is there a better way to do this? Thanks. -AP_ www: http://www.alexparansky.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Design question on loading form data
Subject: Re: Design question on loading form data From: Vic Cekvenich [EMAIL PROTECTED] === Here is sample pseudo code illustrating for one approach in action/perform. Call for the model bean to populate in the action's perform. Maybe the code of that retrieval and anything else having to do with data is in the model bean. I sometimes use the FormBean, with getters and setters, and put a retrieve, update, insert, delete methods in the bean, so model is in one place, should there be any bugs. Also, you can create such a bean, and test it in just a normal servlet, before putting it in Struts. You could also test or use that bean anyplace. package app; public class NameLstAct extends baseAct { public ActionForward mperform( ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // if list sf=(SearchFrm)session.getAttribute(SearchFrm); // get the arguments String fn= sf.getFstName(); String ln= sf.getLstName(); NameLstFrm nl = new NameLstFrm(); // make the Form Bean nl.dbCon(); // ask bean to get a connection from the pool // get us a list of names; based on retrieval argments nl.retrieve(fn,ln); //obviously, the FormBean has the SQL command coded in the above method nl.dbDisCon(); // we do not need the connection no more return(mapping.findForward(nameLstPg)); // if save // {nl.validate(); nl.update(); ... } // if delete {nl.delete(); ...} // if new/insert {nl.inset(); ...} }// perform Act } // end of code. Mattias Norlander wrote: Hello! If i want to fill a form with data (from, say a database) before showing it to the user: Can this be done in reset() method of the form, or should it be in the perform() method of the action class? I think that doing it in the reset() method produces the cleanest code. This can be done in quite a dynamic way too, since the reset method has access to the http request and the mapping. It can use these to get info on what (if any) item to load from the database. Short example: --- I have an action called editOrder and a form called orderForm. In the reset method of the form: reset(mapping,request) { // check mapping, the form might be used by other actions // that don't want our little featue if (mapping.getType.equals(editOrder) { int orderId = request.getInt(orderId); OrderData order = db.loadOrder(orderId); this.orderName = order.getName(); this.orderSize = order.getSize(); // .. and so on } } --- Any suggestions or thoughts around this way of doing things? Looks nice to me, but I'd sure like to know if there is something nasty that I've missed here. Regards, Mattias Norlander -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: html:messages is missing from struts 1.01
Yes, html:messages should be missing from 1.01. The messages is a new tag that is not included in the 1.01 bug fix version, only in the nightly builds and what will be struts 1.1. -Original Message- From: Hai Hoang [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 19, 2002 6:32 PM To: [EMAIL PROTECTED] Subject: html:messages is missing from struts 1.01 I've been using the html:messages for awhile now and I just recently updated to struts version 1.01 and the tag is no longer work. I hate to go back to using html:errors tag and adding the li to the message. Can you guys tell me what are the alternatives? html:messages id=message header=errors.header footer=errors.footer li class=errortextbean:write name=message//li /html:messages __ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]