Re: Struts html:select usage question
On Fri, 31 Dec 2004 09:53:12 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Yes. Use JSTL instead. Jack On Fri, 31 Dec 2004 15:29:45 +0100, Axel Gross [EMAIL PROTECTED] wrote: hi there! the el libs use the jsp 2.0 expression language (${} instead of %= % ) If you don't have a servlet container which supports that by itself, you can use the el-tags to use it at least inside of the struts tags. hth, axel On 2004-12-31 at 13:23:19 +0200, dsarris wrote: On Fri, 31 Dec 2004 11:26:47 +0200, dsarris [EMAIL PROTECTED] wrote: On Thu, 30 Dec 2004 09:23:28 -0700, Wendy Smoak [EMAIL PROTECTED] wrote: From: dsarris [EMAIL PROTECTED] I am trying to use the html:select tag with the html:optionscollection tag. Do I have to put the collection property inside the form bean of the form that contains the html:select? The docs say if you leave off the 'name' attribute, the framework will look to the enclosing form bean. So use 'name' to tell it which bean to use. Is there a reason to use html:optionsCollection over html:options collection=... ? Just curious, I use the second one: html-el:select property=type html-el:options collection=contactTypes property=key labelProperty=value/ /html-el:select (Where contactTypes is a Map sitting in Application scope.) -- Wendy Smoak I managed to fixed it using the name attribute. Thank you. However, where is a distribution of the strus-el library? I am using struts 1.2.4 and I have not found it! Why is better to use the struts-el? -- Dimitris Sarris I found them in the contrib directory ;-). However, I have not found documentation regarding the struts-el extention yet. Hi all and happy new year, Regarding the Struts-EL extention I use the JSTL libraries so it would be no problem to use it. Thank again - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ActionForm automatic type conversion
Hi all and happy new year, I am trying to fill an ActionForm with values that are neither Strings or primitives. The specified values are selected using the html:select tag. This a sample of my JSP code: html:form action=/sumbit.do html:select property=selectedAthlete html:optionsCollection name=controlPanelValues property=athletes label=name value=value / /html:select html:submit bean:message key=cp.button.submit/ /html:submit /html:form The controlPanelValues Bean contains a collection (list) named athletes containing Beans of type Pair. The Pair object contains 2 attributes: The name which is a String and the value which is an Athlete object. My ActionForm contains an attribute named selectedAthlete of the type Athlete. However, whenever I submit this form the selectedAthlete is filled with the string representation of the Athlete type. I used both simple and map-backed actionform with no success. Is Struts capable for doing assignment of non String or primitive fields? Chipix - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session form bean problem -- post again.
Happy new year! Since I posted this problem before Christmas and didn't get answer, I post it again. . I have such action mapping: action path=/Populate type=myClasses.PopulateAction name=SearchForm scope=request validate=false forward name=success path=/search.jsp/ /action - The code in the PopulateAction class is: --- public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); User user = (User) session.getAttribute(Constants.USER_KEY); SearchForm searchForm=(SearchForm) form; searchForm.setZipcode(user.getZipcode()); searchForm.setCity(user.getCity()); searchForm.setState(user.getState()); searchForm.setCountry(user.getCountry()); return (mapping.findForward(success)); } -- I want to populate SearchForm with some existed values(stored in session) before showing search.jsp. This work is done in execute method of PopulateAction. It works well when I use the mapping code shown above. But when I take out the line -- scope=request, that is, I want this form bean to be a session bean. Then the values were not set. They are just the initial values of the form bean. It seems a new form bean object was created after execute method of PopulateAction. Or , execute method of PopulateAction was not executed. Any idea anyone? Thanks in advance. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
create text fields/radio buttons dynamically by reading from db
I need display html tags on the screen such as text fields, radio buttons etc by reading them from the database. Is there any way that the text fields/radio buttons can be created dynamically, in struts framework, by reading the list of html tags from the database. I would not like to hard code the getters and setters in a bean or add the enteries corresponding to the html tags in configuration files for dynaform? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: read html tags from database and display
Jim Barrows jbarrows at sssc.com writes: -Original Message- From: news [mailto:news at sea.gmane.org]On Behalf Of Partho Sent: Thursday, December 30, 2004 10:28 AM To: user at struts.apache.org Subject: read html tags from database and display I need display html tags on the screen such as text fields, radio buttons etc by reading them from the database. Is there any way that the text fields/radio buttons can be created dynamically, in struts framework, by reading the list from the database and without having to hard code the getters and setters in a bean or adding these fields to the configuration files for dynaform? I'm confusled. I think what you want is to put some thing on the page that will read a database, and based on what it finds there create an entire HTML page? On the fly? at run time? Or are you looking for something to run at design time? As you have correctly indicated I would like to put something on a web page that will read a database, and based on what it finds there create an entire HTML page on the fly and at run time. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: create text fields/radio buttons dynamically by reading from db
No, you will not be able to use the struts tags to generate these (html:text, html:radio). You will need to do this 'by hand' unless you can find some other component/framework that can handle this use case. I had the displeasure of working on such a beast about 5 years ago..and let me just say..it was ugly. -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Partho Sandell [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, January 03, 2005 10:10 AM Subject: create text fields/radio buttons dynamically by reading from db I need display html tags on the screen such as text fields, radio buttons etc by reading them from the database. Is there any way that the text fields/radio buttons can be created dynamically, in struts framework, by reading the list of html tags from the database. I would not like to hard code the getters and setters in a bean or add the enteries corresponding to the html tags in configuration files for dynaform? - 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: read html tags from database and display
On Thu, 30 Dec 2004 17:27:38 + (UTC), Partho [EMAIL PROTECTED] wrote: I need display html tags on the screen such as text fields, radio buttons etc by reading them from the database. Is there any way that the text fields/radio buttons can be created dynamically, in struts framework, by reading the list from the database and without having to hard code the getters and setters in a bean or adding these fields to the configuration files for dynaform? What about indexed/mapped properties? See http://struts.apache.org/faqs/indexedprops.html Pavel Kolesnikov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: create text fields/radio buttons dynamically by reading from db
Creating the underlying HTML yourself is relatively trivial. I did something similar a few months back... I had to create a web-based repot design tool (let's not get into why we couldn't use any of the millions of canned solutions to this...) Anyway, the report itself was basically constructed of a large number of div tags, all with different style attributes. All of these details were retrieved from a database. In these layers were all sorts of text, images, database field references, etc., all the stuff you'd typically see on a banded report design tool. So, what was rendered in the browser was generated completely dynamically from the database entriesm but was of course just plain HTML. This isn't exactly like what your trying to do, but it is similar. It's just a matter of generating div's and their content vs. creating input's and their content. Remember, the taglibs are optional components, and they render straight HTML in the end anyway, so just bypass them and you can do what you want. I would say James is right, it IS ugly, but only if you are used to using the taglibs in the first place. If you use them all the time, then yes, this will appear ugly :) If you don't use them much now though, this really doesn't seem so bad. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com James Mitchell wrote: No, you will not be able to use the struts tags to generate these (html:text, html:radio). You will need to do this 'by hand' unless you can find some other component/framework that can handle this use case. I had the displeasure of working on such a beast about 5 years ago..and let me just say..it was ugly. -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Partho Sandell [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, January 03, 2005 10:10 AM Subject: create text fields/radio buttons dynamically by reading from db I need display html tags on the screen such as text fields, radio buttons etc by reading them from the database. Is there any way that the text fields/radio buttons can be created dynamically, in struts framework, by reading the list of html tags from the database. I would not like to hard code the getters and setters in a bean or add the enteries corresponding to the html tags in configuration files for dynaform? - 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: ActionForm automatic type conversion
On Mon, 3 Jan 2005 11:16:16 +0200, dsarris [EMAIL PROTECTED] wrote: I am trying to fill an ActionForm with values that are neither Strings or primitives. I think you can do it by extending the RequestProcessor class and overloading processPopulate method or something like that. But in general - I guess you should better avoid it. HTML forms are designed for sending String values typed by user and Struts layer (= ActionForms or Actions) should transform them into appropriate business objects. If you tell us something about why you need it, it could be possible to find out better designed (IMHO) solution. Pavel Kolesnikov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Check Tag problem?
It simply says it can't find tile definition referenced by name attribute of your useAttribute tag. Try to check out if your tiles definitions. Pavel On Mon, 03 Jan 2005 03:08:57 +, Jim Douglas [EMAIL PROTECTED] wrote: I used the example that came with tiles to create a site and I keep getting this error below, ERROR - Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184) at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) Where do I look to check the Tag Syntax?. (I never changed it!) The only thing I have done is to move all the layout files into a common directory. (columnslayout.jsp, body.jsp, header.jsp and footer.jsp. I made sure the files are in the right location but I keep getting this error) Jim - 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: Check Tag problem?
useAttribute is in struts-tiles.tld...still no luck. This is frustrating because it is from the example that comes with Tiles. Does anybody know of any IDE's that allow you to step thru JSP code? ...this is vboxLayout.jsp, %@ page import=java.util.Iterator% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % %-- Layout component Render a list of tiles in a vertical column @param : list List of names to insert --% tiles:useAttribute id=list name=list classname=java.util.List / %-- Iterate over names. We don't use iterate tag because it doesn't allow insert (in JSP1.1) --% % Iterator i=list.iterator(); while( i.hasNext() ) { String name= (String)i.next(); % tiles:insert name=%=name% flush=true / br % } // end loop % ...this is columnsLayout.jsp, %@ page import=org.apache.struts.tiles.ComponentContext% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % %-- Layout component Render a list on severals columns parameters : numCols, list0, list1, list2, list3, ... --% tiles:useAttribute id=numColsStr name=numCols classname=java.lang.String / table tr % int numCols = Integer.parseInt(numColsStr); ComponentContext context = ComponentContext.getContext( request ); for( int i=0; inumCols; i++ ) { java.util.List list=(java.util.List)context.getAttribute( list + i ); pageContext.setAttribute(list, list ); if(list==null) System.out.println( list is null for + i ); % td valign=top tiles:insert page=/common/layouts/vboxLayout.jsp flush=true tiles:put name=componentsList beanName=list beanScope=page / /tiles:insert /td % } // end loop % /tr /table This is the error... DEBUG - insert page='/common/layouts/columnsLayout.jsp'. DEBUG - servletPath=/common/layouts/columnsLayout.jsp, pathInfo=null, queryString=null, name=null DEBUG - Path Based Include DEBUG - insert page='/common/layouts/vboxLayout.jsp'. DEBUG - servletPath=/common/layouts/vboxLayout.jsp, pathInfo=null, queryString=null, name=null DEBUG - Path Based Include ERROR - Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184) at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73) Jim From: Pavel Kolesnikov [EMAIL PROTECTED] Reply-To: Pavel Kolesnikov [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: Check Tag problem? Date: Mon, 3 Jan 2005 18:52:21 +0100 It simply says it can't find tile definition referenced by name attribute of your useAttribute tag. Try to check out if your tiles definitions. Pavel On Mon, 03 Jan 2005 03:08:57 +, Jim Douglas [EMAIL PROTECTED] wrote: I used the example that came with tiles to create a site and I keep getting this error below, ERROR - Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184) at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) Where do I look to check the Tag Syntax?. (I never changed it!) The only thing I have done is to move all the layout files into a common directory. (columnslayout.jsp, body.jsp, header.jsp and footer.jsp. I made sure the files are in the right location but I keep getting this error) Jim - 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: Check Tag problem?
I just noticed a difference between the struts-tiles.tld files ?xml version=1.0 encoding=UTF-8? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; taglib tlibversion1.0/tlibversion jspversion1.1/jspversion shortnameTiles Tag Library/shortname urihttp://jakarta.apache.org/struts/tags-tiles-1.1/uri tag ?xml version=1.0 encoding=UTF-8? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; taglib tlibversion1.2/tlibversion jspversion1.1/jspversion shortnametiles/shortname urihttp://struts.apache.org/tags-tiles/uri tag Does anyone know where to find info as to what I need to do to updrage to the latest version tlibversion? Jim From: Jim Douglas [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: [EMAIL PROTECTED], user@struts.apache.org Subject: Re: Check Tag problem? Date: Mon, 03 Jan 2005 22:32:57 + useAttribute is in struts-tiles.tld...still no luck. This is frustrating because it is from the example that comes with Tiles. Does anybody know of any IDE's that allow you to step thru JSP code? ...this is vboxLayout.jsp, %@ page import=java.util.Iterator% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % %-- Layout component Render a list of tiles in a vertical column @param : list List of names to insert --% tiles:useAttribute id=list name=list classname=java.util.List / %-- Iterate over names. We don't use iterate tag because it doesn't allow insert (in JSP1.1) --% % Iterator i=list.iterator(); while( i.hasNext() ) { String name= (String)i.next(); % tiles:insert name=%=name% flush=true / br % } // end loop % ...this is columnsLayout.jsp, %@ page import=org.apache.struts.tiles.ComponentContext% %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % %-- Layout component Render a list on severals columns parameters : numCols, list0, list1, list2, list3, ... --% tiles:useAttribute id=numColsStr name=numCols classname=java.lang.String / table tr % int numCols = Integer.parseInt(numColsStr); ComponentContext context = ComponentContext.getContext( request ); for( int i=0; inumCols; i++ ) { java.util.List list=(java.util.List)context.getAttribute( list + i ); pageContext.setAttribute(list, list ); if(list==null) System.out.println( list is null for + i ); % td valign=top tiles:insert page=/common/layouts/vboxLayout.jsp flush=true tiles:put name=componentsList beanName=list beanScope=page / /tiles:insert /td % } // end loop % /tr /table This is the error... DEBUG - insert page='/common/layouts/columnsLayout.jsp'. DEBUG - servletPath=/common/layouts/columnsLayout.jsp, pathInfo=null, queryString=null, name=null DEBUG - Path Based Include DEBUG - insert page='/common/layouts/vboxLayout.jsp'. DEBUG - servletPath=/common/layouts/vboxLayout.jsp, pathInfo=null, queryString=null, name=null DEBUG - Path Based Include ERROR - Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184) at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73) Jim From: Pavel Kolesnikov [EMAIL PROTECTED] Reply-To: Pavel Kolesnikov [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re: Check Tag problem? Date: Mon, 3 Jan 2005 18:52:21 +0100 It simply says it can't find tile definition referenced by name attribute of your useAttribute tag. Try to check out if your tiles definitions. Pavel On Mon, 03 Jan 2005 03:08:57 +, Jim Douglas [EMAIL PROTECTED] wrote: I used the example that came with tiles to create a site and I keep getting this error below, ERROR - Servlet.service() for servlet jsp threw exception javax.servlet.jsp.JspException: Error - tag useAttribute : attribute 'list' not found in context. Check tag syntax at org.apache.struts.taglib.tiles.UseAttributeTag.doStartTag(UseAttributeTag.java:184) at org.apache.jsp.common.layouts.vboxLayout_jsp._jspService(org.apache.jsp.common.layouts.vboxLayout_jsp:73) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:99) Where do I look to check the Tag Syntax?. (I never changed it!) The only thing I have done is to move all the layout files into a common directory. (columnslayout.jsp, body.jsp, header.jsp and footer.jsp. I made sure the files are in the right location but I keep getting this error) Jim - 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: Check Tag problem?
http://wiki.apache.org/struts/StrutsUpgradeNotes11to124 Jim Douglas wrote: I just noticed a difference between the struts-tiles.tld files ?xml version=1.0 encoding=UTF-8? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; taglib tlibversion1.0/tlibversion jspversion1.1/jspversion shortnameTiles Tag Library/shortname urihttp://jakarta.apache.org/struts/tags-tiles-1.1/uri tag ?xml version=1.0 encoding=UTF-8? !DOCTYPE taglib PUBLIC -//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd; taglib tlibversion1.2/tlibversion jspversion1.1/jspversion shortnametiles/shortname urihttp://struts.apache.org/tags-tiles/uri tag Does anyone know where to find info as to what I need to do to updrage to the latest version tlibversion? Jim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
validation issues when using multiple modules
No one ever responded to my follow up, so I'm trying again: It is version 1.2.4. 1) Both modules (root module and submodule) are configured as follows in web.xml: servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/lister/param-name param-value/WEB-INF/struts-lister-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet 2) Root module has its message resources and validation configured in its struts-config.xml as follows: message-resources parameter=com.dchoc.toblerone.web.Resources null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in 3) Submodule has its messages resources and validation configured in its struts-lister-config.xml as follows: message-resources parameter=com.dchoc.toblerone.ext.lister.web.Resources key= null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation-lister.xml/ /plug-in Note that null is set to false, and yet no error message appears for the key it doesn't seem to be able to find, just an empty string. 4) In the JSP where the action lives (an action in the submodule that is defined in its struts-lister-config.xml) that is configured to do the validation in question, html:errors is used as follows. html:errors bundle=/lister/ Note, in that same JSP, the submodule's bundle is used to print out all form labels and buttons with no problem as follows: table class=grid border=0 cellspacing=2 cellpadding=2 tr th bean:message bundle=/lister key=list.name/ /th td bean:write name=listView property=name/ /td /tr tr th bean:message bundle=/lister key=list.size/ /th td html:text property=size size=3 maxlength=3/ /td /tr tr height=20/tr tr td width=80/td td align=right html:cancel bean:message bundle=/lister key=cancel/ /html:cancel /td td html:submit bean:message bundle=/lister key=save/ /html:submit /td /tr /table Note that the list.size key referenced here is the same one referred to in the validation.xml that does not show up in the error messages, but it shows up just fine on this page when printed out as a form label. Any help would be most appreciated. Leigh On Mon, 2004-12-20 at 16:52, Leigh Estes wrote: From: Niall Pemberton [EMAIL PROTECTED] Subject: validation issues when using multiple modules Date: Fri, 17 Dec 2004 01:40:09 - Content-Type: text/plain; charset=iso-8859-1 When you say Struts 1.2 - is that version 1.2.4? Can you post the relevant bits of config/code: - show how you have the message resources configured in your struts-configs - show how your using html:errors Niall - Original Message - From: Leigh Estes [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, December 17, 2004 12:29 AM Subject: validation issues when using multiple modules I have configured two modules in my web application using Struts 1.2. Each has its own struts config as defined in the web application's web.xml. Each has its own validation XML and resource bundles as defined in their respective struts config files. The problem I'm seeing is that if I violate a validation rule for the root module (/), everything works as expected and I see the appropriate error message on the page. However, if I
New to Struts seeking advice
Hi All, I've developed several web applications over the last 10 years, mostly based on Perl CGI. The 2003 project I did made me swear off CGI and look for something that does a better job of maintaining session and data across pages, among other things. Struts seems to fit the bill. But: what's a recommended set of tools to use? I've been working a bit with Netbeans 4.0 on sample applications and it does a fine job building a .WAR file for deployment. But it doesn't seem to have enough smarts to see when something is broken enough that Tomcat (v 5.0.28) chokes on it with an unhelpful error message. Also, I tried installing the Struts Console into this version of Netbeans and got: Warning - could not install some modules: Struts Console - No module providing the capability org.openide.compiler.CompilationEngine could be found. Struts Console - No module providing the capability org.openide.TopManager could be found. Struts Console - The module named org.openide.deprecated was needed and not found. Struts Console - The module named org.openide.compiler was needed and not found. Struts Console - The module named org.openide.execution.deprecated was needed and not found. So: *Is Eclipse or something else clearly better and more Struts-capable? *Is AppFuse worth using as a basis for a real app? I tried working through the tutorial and got it going, but it is based on Hibernate and I was told that Hibernate may not be mature enough for deployment? * Any other tools or techniques that you fervently recommend or recommend avoiding? Thanks in advance for any guidance whatsoever. -- Mark McWiggins 425-369-8286 (let ring) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: (newbie) Error when installed Struts 1.2
Hi, It is already in the web.xml file, still it is giving the error. Thank you. Sudheer -Original Message- From: Richard Yee [mailto:[EMAIL PROTECTED] Sent: Sunday, January 02, 2005 9:55 PM To: Struts Users Mailing List Subject: Re: (newbie) Error when installed Struts 1.2 Sudheer, Check your web.xml file. It appears that you are missing the servlet and servlet-mapping entries for the ActionServlet. servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param load-on-startup1/load-on-startup /servlet servlet-mapping servlet-nameaction/servlet-name url-pattern*.do/url-pattern /servlet-mapping Regards, Richard At 12:24 AM 1/2/2005, you wrote: Hi, My struts application shows the following two erros when I upgraded Struts 1.1 to 1.2. This was working fine under Struts 1.1. Also attached struts-config.xml and web.xml Please help. Thank you. Sudheer Error 1 --- type : Status report message : Servlet action is not available description : The requested resource (Servlet action is not available) is not available. Error 2 --- javax.servlet.ServletException: Cannot find message resources under key org.apache.struts.action.MESSAGE org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContext Impl.java:825) org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextIm pl.java:758) org.apache.jsp.general.users.login_jsp._jspService(login_jsp.java:114) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java: 324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) - 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]
using bean:write to write out html
I'm trying to use the struts bean:write tag to render an html page. The html that I would like to display is generated dynamically based on a given parameter that is passed to my action. I place the generated html in a string that is contained in a form. When returning from the action. The HTML is displayed as a string without being interpreted by the browser. Any help is greatly appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation issues when using multiple modules
Hi, I havn't use multi-module but multi-config.xml. My setting of Validator is centralised in one config.xml. You may try. plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml, /WEB-INF/validation-lister.xml/ /plug-in Good Luck. Cliff - Original Message - From: Leigh Estes [EMAIL PROTECTED] To: user@struts.apache.org Sent: Tuesday, January 04, 2005 8:06 AM Subject: validation issues when using multiple modules No one ever responded to my follow up, so I'm trying again: It is version 1.2.4. 1) Both modules (root module and submodule) are configured as follows in web.xml: servlet servlet-nameaction/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-nameconfig/lister/param-name param-value/WEB-INF/struts-lister-config.xml/param-value /init-param init-param param-namedebug/param-name param-value2/param-value /init-param init-param param-namedetail/param-name param-value2/param-value /init-param init-param param-namevalidate/param-name param-valuetrue/param-value /init-param load-on-startup1/load-on-startup /servlet 2) Root module has its message resources and validation configured in its struts-config.xml as follows: message-resources parameter=com.dchoc.toblerone.web.Resources null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation.xml/ /plug-in 3) Submodule has its messages resources and validation configured in its struts-lister-config.xml as follows: message-resources parameter=com.dchoc.toblerone.ext.lister.web.Resources key= null=false/ plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml, /WEB-INF/validation-lister.xml/ /plug-in Note that null is set to false, and yet no error message appears for the key it doesn't seem to be able to find, just an empty string. 4) In the JSP where the action lives (an action in the submodule that is defined in its struts-lister-config.xml) that is configured to do the validation in question, html:errors is used as follows. html:errors bundle=/lister/ Note, in that same JSP, the submodule's bundle is used to print out all form labels and buttons with no problem as follows: table class=grid border=0 cellspacing=2 cellpadding=2 tr th bean:message bundle=/lister key=list.name/ /th td bean:write name=listView property=name/ /td /tr tr th bean:message bundle=/lister key=list.size/ /th td html:text property=size size=3 maxlength=3/ /td /tr tr height=20/tr tr td width=80/td td align=right html:cancel bean:message bundle=/lister key=cancel/ /html:cancel /td td html:submit bean:message bundle=/lister key=save/ /html:submit /td /tr /table Note that the list.size key referenced here is the same one referred to in the validation.xml that does not show up in the error messages, but it shows up just fine on this page when printed out as a form label. Any help would be most appreciated. Leigh On Mon, 2004-12-20 at 16:52, Leigh Estes wrote: From: Niall Pemberton [EMAIL PROTECTED] Subject: validation issues when using multiple modules Date: Fri, 17 Dec 2004 01:40:09 - Content-Type: text/plain; charset=iso-8859-1 When you say Struts 1.2 - is that version 1.2.4? Can you post the relevant bits of config/code: - show how you have the message resources configured in your struts-configs - show how your using html:errors Niall - Original Message - From: Leigh Estes [EMAIL PROTECTED] To: user@struts.apache.org Sent: Friday, December 17, 2004 12:29 AM Subject: validation issues when using multiple modules I have configured two modules in my web application using Struts 1.2. Each has its own struts config as defined in the web application's web.xml. Each has its own validation XML and resource bundles as defined in their respective struts config files. The problem I'm seeing is that if I violate a validation rule for the root
RE: using bean:write to write out html
Set filter=false in the bean:write tag. RTFM for more info. -Original Message- From: kjc [mailto:[EMAIL PROTECTED] Sent: Monday, January 03, 2005 5:58 PM I'm trying to use the struts bean:write tag to render an html page. The html that I would like to display is generated dynamically based on a given parameter that is passed to my action. I place the generated html in a string that is contained in a form. When returning from the action. The HTML is displayed as a string without being interpreted by the browser. Any help is greatly appreciated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
isSessionValid request tag is false
Hi, I am using the following request tags from jakarta taglibs in my JSP req:isSessionValid value=false jsp:forward page=/SessionExpired.jsp / /req:isSessionValid I am checking in my action class and the session is available and I forward to the JSP containing the above lines. Why does it always get forwarded SessionExpired.jsp -Aswath __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: isSessionValid request tag is false
Hi, And this happens only for the first time I open the browser and perform the action. Thanks -Aswath --- ans [EMAIL PROTECTED] wrote: Hi, I am using the following request tags from jakarta taglibs in my JSP req:isSessionValid value=false jsp:forward page=/SessionExpired.jsp / /req:isSessionValid I am checking in my action class and the session is available and I forward to the JSP containing the above lines. Why does it always get forwarded SessionExpired.jsp -Aswath __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Send holiday email and support a worthy cause. Do good. http://celebrity.mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session form bean problem -- post again.
T.T., If you want to display something form the session object stored with Constants.USER_KEY in /search.jsp (your success forward), you don't need to copy the values in your Action's execute() method. Just specify another bean (in any scope) with the 'name=User' attribute/value pair. Of course, you'll have to change User to the actual string defined by Constants.USER_KEY. This works for many tags in the bean and html taglibs. Regards, David -Original Message- From: t t [mailto:[EMAIL PROTECTED] Sent: Monday, January 03, 2005 9:30 AM To: user@struts.apache.org Subject: session form bean problem -- post again. Happy new year! Since I posted this problem before Christmas and didn't get answer, I post it again. . I have such action mapping: action path=/Populate type=myClasses.PopulateAction name=SearchForm scope=request validate=false forward name=success path=/search.jsp/ /action - The code in the PopulateAction class is: --- public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); User user = (User) session.getAttribute(Constants.USER_KEY); SearchForm searchForm=(SearchForm) form; searchForm.setZipcode(user.getZipcode()); searchForm.setCity(user.getCity()); searchForm.setState(user.getState()); searchForm.setCountry(user.getCountry()); return (mapping.findForward(success)); } -- I want to populate SearchForm with some existed values(stored in session) before showing search.jsp. This work is done in execute method of PopulateAction. It works well when I use the mapping code shown above. But when I take out the line -- scope=request, that is, I want this form bean to be a session bean. Then the values were not set. They are just the initial values of the form bean. It seems a new form bean object was created after execute method of PopulateAction. Or , execute method of PopulateAction was not executed. Any idea anyone? Thanks in advance. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Help : execute a equation in String format
hi , I have equation in String format like String equ = ((123*123+567-7899*340)/1234)*1000; now i want to execute this equation and get the result .. How can i achieve this in java ? note : This is not a struts -related issue ... yet i need help so i posted .. hope nobody minds much Regards, Sachin Hegde Software Developer Paradyne Infotech Limited , Mumbai 09324546711 There are three kinds of lies: lies, damn lies, and statistics. -Benjamin Disraeli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help : execute a equation in String format
Hi Sachin, You can use java.math class to achieve what you want. To be precise you can java.math.BigDecimal and then convert your result into string object. Hope this helps. Cheers Apurva -Original Message- From: sachin [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 5:34 PM To: Struts Users Mailing List Subject: Help : execute a equation in String format hi , I have equation in String format like String equ = ((123*123+567-7899*340)/1234)*1000; now i want to execute this equation and get the result .. How can i achieve this in java ? note : This is not a struts -related issue ... yet i need help so i posted .. hope nobody minds much Regards, Sachin Hegde Software Developer Paradyne Infotech Limited , Mumbai 09324546711 There are three kinds of lies: lies, damn lies, and statistics. -Benjamin Disraeli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Help : execute a equation in String format
hi apurva , To be precise you can java.math.BigDecimal and then convert your result into string object. Thanks for ur reply . The equation builder can be achieved this way. But if the query is complex it takes a long way ... like looking for the innermost brackets, aplying square roots , squares , * , / , + , - etc ..and more . So i was looking for some library class which can take an arithmetic equation and deliver its result .. but if this sort of thing is not available .. then i will have to develope it. Regards, Sachin Hegde Software Developer Paradyne Infotech Limited , Mumbai 09324546711 The believer is happy. The doubter is wise. -Benjamin Disraeli -- Original Message --- From: Apurva Goswami [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tue, 4 Jan 2005 17:28:43 +1100 Subject: RE: Help : execute a equation in String format Hi Sachin, You can use java.math class to achieve what you want. To be precise you can java.math.BigDecimal and then convert your result into string object. Hope this helps. Cheers Apurva -Original Message- From: sachin [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 04, 2005 5:34 PM To: Struts Users Mailing List Subject: Help : execute a equation in String format hi , I have equation in String format like String equ = ((123*123+567-7899*340)/1234)*1000; now i want to execute this equation and get the result .. How can i achieve this in java ? note : This is not a struts -related issue ... yet i need help so i posted .. hope nobody minds much Regards, Sachin Hegde Software Developer Paradyne Infotech Limited , Mumbai 09324546711 There are three kinds of lies: lies, damn lies, and statistics. -Benjamin Disraeli - 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] --- End of Original Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]