Re: how to use bean:define for this
or maybe use jsp:useBean .. will create a default bean, if it can't find an instance so, if you make a bean which uses the the static method for initialisation of a collections property (in default constructor) you can go without the scriptlet regards, axel On 2004-03-13 at 14:08:13 -0500, Geeta Ramani wrote: Dean: Yes, I do see your problem and since (as i inderstand it) Struts tags work via reflection, it needs an instance of the class before you can use bean:define kind of things.. So my guess is you will have to bite the bullet and just use plain Java (remember the good ole days??..;)): %java.util.Collection allCountries = myClass.myStaticMethod.getCountries; % and then go ahead and use allCountries as usual later in your jsp.. I believe you can use it within struts tags with no problem.. Regards, Geeta Dean A. Hoover wrote: that's what I am trying to avoid... I am already doing it in an Action. I want the collection to be instantiating in JSP where it is used. The reason I am putting it in session is that the data comes out of a database but is quite static. Are you suggesting application scope or page? As I said in my previous message, I already have a class with a static method that will return a populated collection. Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use bean:define for this
Dean: First, you need this countries Collection available in kind of an application-wide context, right? I mean there is no reason to attach this as a session variable since I imagine it would not change from user to user... Also such variables are best initialised/populated in a class (the model) rather than in a jsp, since jsps should just be used mainly for the view.. So i guess I don't see why you are thinking of bean:define tags for instantiating this Collection...? Am i misunderstanding your problem..? Regards, Geeta Dean A. Hoover wrote: I am still on a steep learning curve for struts/tiles and to a degree, trying to remember certain things about JSP. Anyway, struts has this construct I want to use for building an HTML select tagset from a java collection. Here's the jsp snippet: html:select property=contactInfoWidgetsSubFormCountryCode html:options collection=countries property=value labelProperty=label/ /html:select The reference to countries is a java.util.Collection that is put into the session. I have a class I wrote CountryOptions that contains one static method: public static Collection getOptions() that creates what it needs to. Now what I need to figure out is the best way to instantiate the countries variable in the session. I think it might be by using the bean:define tag, but I am not sure. Has anyone done this before? Thanks. Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use bean:define for this
Dean: Oh, Ok, I think i see what your issue is now (shouldn't have hit that earlier send so fast..!) Ok, in the action before you forward to the jsp, populate your countries variable. Then set your session variable (in your Action class), say, session.setAttribute(countries, countries); (though i still wonder about making this a session var.. anyway..). In your jsp then you can simply say: bean:define id=allCountries name=countries scope=session type=java.util.Collection / You should then be able to access the allCountries Collection further down in your jsp.. Hope this helps, Geeta that creates what it needs to. Now what I need to figure out is the best way to instantiate the countries variable in the session. I think it might be by using the bean:define tag, but I am not sure. Has anyone done this before? Thanks. Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use bean:define for this
Geeta Ramani wrote: Dean: Oh, Ok, I think i see what your issue is now (shouldn't have hit that earlier send so fast..!) Ok, in the action before you forward to the jsp, populate your countries variable. Then set your session variable (in your Action class), say, session.setAttribute(countries, countries); (though i still wonder about making this a session var.. anyway..). that's what I am trying to avoid... I am already doing it in an Action. I want the collection to be instantiating in JSP where it is used. The reason I am putting it in session is that the data comes out of a database but is quite static. Are you suggesting application scope or page? As I said in my previous message, I already have a class with a static method that will return a populated collection. Dean In your jsp then you can simply say: bean:define id=allCountries name=countries scope=session type=java.util.Collection / You should then be able to access the allCountries Collection further down in your jsp.. Hope this helps, Geeta that creates what it needs to. Now what I need to figure out is the best way to instantiate the countries variable in the session. I think it might be by using the bean:define tag, but I am not sure. Has anyone done this before? Thanks. Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to use bean:define for this
Dean: Yes, I do see your problem and since (as i inderstand it) Struts tags work via reflection, it needs an instance of the class before you can use bean:define kind of things.. So my guess is you will have to bite the bullet and just use plain Java (remember the good ole days??..;)): %java.util.Collection allCountries = myClass.myStaticMethod.getCountries; % and then go ahead and use allCountries as usual later in your jsp.. I believe you can use it within struts tags with no problem.. Regards, Geeta Dean A. Hoover wrote: that's what I am trying to avoid... I am already doing it in an Action. I want the collection to be instantiating in JSP where it is used. The reason I am putting it in session is that the data comes out of a database but is quite static. Are you suggesting application scope or page? As I said in my previous message, I already have a class with a static method that will return a populated collection. Dean - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define Compile time exception on Orion
On Orion, the bean:define / tag gives compile time error when it declares an array e.g. : bean:define id=a name=a type=b.C[] / Here C is a class in package b. Is there anything wrong with the syntax ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define Compile time exception on Orion
Hello Kazim, A quick test on my JSP page with Strtus 1.1 in place just works fine: % String[] names = {joe, cindy}; session.setAttribute(names, names); % bean:define id=n name=names scope=session type=java.lang.String[] / logic:iterate name=n id=name bean:write name=name/ /logic:iterate what's the error message you're getting? ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:16 PM Subject: bean:define Compile time exception on Orion On Orion, the bean:define / tag gives compile time error when it declares an array e.g. : bean:define id=a name=a type=b.C[] / Here C is a class in package b. Is there anything wrong with the syntax ? - 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: bean:define Compile time exception on Orion
Could not find bean under name a This works on Tomcat. -Original Message- From: atta-ur rehman [mailto:[EMAIL PROTECTED] Sent: Saturday, March 13, 2004 3:29 AM To: Struts Users Mailing List Subject: Re: bean:define Compile time exception on Orion Hello Kazim, A quick test on my JSP page with Strtus 1.1 in place just works fine: % String[] names = {joe, cindy}; session.setAttribute(names, names); % bean:define id=n name=names scope=session type=java.lang.String[] / logic:iterate name=n id=name bean:write name=name/ /logic:iterate what's the error message you're getting? ATTA - Original Message - From: Syed Kazim Hussain [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 12, 2004 1:16 PM Subject: bean:define Compile time exception on Orion On Orion, the bean:define / tag gives compile time error when it declares an array e.g. : bean:define id=a name=a type=b.C[] / Here C is a class in package b. Is there anything wrong with the syntax ? - 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]
bean:define ???
Anybody knows how can I define a script variable with bean define tag or another, for the first element of a collection??? for example: % ArrayList users = (ArrayList)pageContext.getAttribute(users); User user = users.get(0); % How I do it with tags??? Because I want to get the firt element of a collection, e define it! Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bean:define ???
Mauricio, I think this is what you'd be looking for: %@ taglib prefix=c uri=http://java.sun.com/jstl/core; % c:set var=users value=${pageContext.users} / c:set var=user value=${users[0]} / I'm pretty sure that arraylists (being that they are collections) in the c: taglib will take brackets... HTH, Glenn -Original Message- From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] Sent: Saturday, February 28, 2004 11:02 AM To: Struts Users Mailing List Subject: bean:define ??? Anybody knows how can I define a script variable with bean define tag or another, for the first element of a collection??? for example: % ArrayList users = (ArrayList)pageContext.getAttribute(users); User user = users.get(0); % How I do it with tags??? Because I want to get the firt element of a collection, e define it! 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]
RE: bean:define ???
Anybody knows how can I define a script variable with bean define tag or another, for the first element of a collection??? for example: % ArrayList users = (ArrayList)pageContext.getAttribute(users); User user = users.get(0); % c:set target=user value=${users[0]}/ Not sure exactly how pageContext translates, but I think this will do it. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define ??? I think
I want to create a scriptlet variable with tag struts, how can I do it??? for example: I have: String testStr = session.getAttribute(test); but I don´t want use it, it´s ugly!!! I saw the tag bean:define id=testStr property=test/ but whe I try show it with a expression ( %=testStr%) I have canot resolve the symbol error!!! But when I use the bean:write name=testStr/ I show the value, but I have to use %=testStr% Anybody can help me? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define I think ???
I want to create a scriptlet variable with tag struts, how can I do it??? for example: I have: String testStr = session.getAttribute(test); but I don´t want use it, it´s ugly!!! I saw the tag bean:define id=testStr property=test/ but whe I try show it with a expression ( %=testStr%) I have canot resolve the symbol error!!! But when I use the bean:write name=testStr/ I show the value, but I have to use %=testStr% Anybody can help me?
bean:define .. problem
Dear all I have problem about migration from struts 1.0 to 1.1. It compile error Can not resolve symbol. Is there the way to migrate without change jsp page. Because my jsp page is very many. It take a time to change. Your faithfully Surachai
RE: bean:define I think ???
If you need to use %= testStr% because nesting tags doesn't work then use Struts-el instead. You can do it in one line: html:text property=foo value=${sessionScope.test} / bean:define id=testStr property=test/ doesn't work because you haven't specified the name attribute: http://jakarta.apache.org/struts/userGuide/struts-bean.html#define I think you want to use bean:define id=testStr name=test/ Greg -Original Message- From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED] Sent: Monday, November 24, 2003 2:28 PM To: Struts Users Mailing List Subject: bean:define I think ??? I want to create a scriptlet variable with tag struts, how can I do it??? for example: I have: String testStr = session.getAttribute(test); but I don´t want use it, it´s ugly!!! I saw the tag bean:define id=testStr property=test/ but whe I try show it with a expression ( %=testStr%) I have canot resolve the symbol error!!! But when I use the bean:write name=testStr/ I show the value, but I have to use %=testStr% Anybody can help me? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bean:define .. problem
My guess is, you are using Weblogic8 which has problem with its jsp engine. Don't know if the fix it yet, but for short you might have to change your jsp from: bean:define id=borrowerIndex name=borrowerIndex scope=request / To... bean:define id=borrowerIndexbean:write name=borrowerIndex scope=request //bean:define Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Surachai Locharoen [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 8:13 PM To: Struts Users Mailing List Subject: bean:define .. problem Dear all I have problem about migration from struts 1.0 to 1.1. It compile error Can not resolve symbol. Is there the way to migrate without change jsp page. Because my jsp page is very many. It take a time to change. Your faithfully Surachai This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define .. problem
Yes I use weblogic8. If I change jsp to your suggestion,when weblogic is fixed problem. Does my jsp still work? and Does my jsp stiill work with other jsp engine? Thank you - Original Message - From: Trieu, Danny [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 8:23 AM Subject: RE: bean:define .. problem My guess is, you are using Weblogic8 which has problem with its jsp engine. Don't know if the fix it yet, but for short you might have to change your jsp from: bean:define id=borrowerIndex name=borrowerIndex scope=request / To... bean:define id=borrowerIndexbean:write name=borrowerIndex scope=request //bean:define Danny Trieu Internet Business Group Downey Savings and Loan Association, F.A. [EMAIL PROTECTED] (949) 509-4564 The beginning of knowledge is the discovery of something we do not understand. - Frank Herbert (1920-1986) The essence of knowledge is, having it, to apply it; not having it, to confess your ignorance. - Confucius (551-479 BC) -Original Message- From: Surachai Locharoen [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 25, 2003 8:13 PM To: Struts Users Mailing List Subject: bean:define .. problem Dear all I have problem about migration from struts 1.0 to 1.1. It compile error Can not resolve symbol. Is there the way to migrate without change jsp page. Because my jsp page is very many. It take a time to change. Your faithfully Surachai This message and any attachments are for the intended recipient(s) only and may contain privileged, confidential and/or proprietary information about Downey Savings or its customers, which Downey Savings does not intend to disclose to the public. If you received this message by mistake, please notify the sender by reply e-mail and delete the message and attachments. - 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]
bean:define question
Hi, If I have % List myList = (List) someList; % where someList is a list of objects whose name property I want to display in a dropdown, why doesn't the following work? bean:define id=availableNames name=myList type=java.util.List / html:options collection=availableNames property=name/ Thanks, Sonam -- NOTICE: If received in error, please destroy and notify sender. Sender does not waive confidentiality or privilege, and use is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define question
It doesn't work because you must put the variable into the page scope: % List myList = (List) someList; pageContext.setAttribute(myList, myList); % If I have % List myList = (List) someList; % where someList is a list of objects whose name property I want to display in a dropdown, why doesn't the following work? bean:define id=availableNames name=myList type=java.util.List / html:options collection=availableNames property=name/ -- Nick Heudecker SystemMobile, Inc. Email: [EMAIL PROTECTED] Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using bean:define tag
use bean:write name=fieldxyz/ instead of %= fieldxyz % - Original Message - From: Marimuthu Saravanan To: [EMAIL PROTECTED] Sent: Wednesday, October 01, 2003 8:30 AM Subject: Problem using bean:define tag Hi, I am getting a error while using bean:define tag ( Struts 1.1).Here is the code snippets. Action class: Setting value in the request attribute request.setAttribute( field1, countryCode); Jsp: %@ page language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:html locale=true bean:define id=fieldxyz name=field1 / %= fieldxyz % /html:html Jsp is not getting compiled. Kindly provide me solution Regards Saravanan -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem using bean:define tag
Hi, I am getting a error while using bean:define tag ( Struts 1.1).Here is the code snippets. Action class: Setting value in the request attribute request.setAttribute( field1, countryCode); Jsp: %@ page language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:html locale=true bean:define id=fieldxyz name=field1 / %= fieldxyz % /html:html Jsp is not getting compiled. Kindly provide me solution Regards Saravanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem using bean:define tag
y u r using %= fieldxyz %.u can use bean:write name=fieldxyz/ no? -- From: Marimuthu Saravanan[SMTP:[EMAIL PROTECTED] Reply To: Struts Users Mailing List Sent: Wednesday, October 01, 2003 12:00 PM To: [EMAIL PROTECTED] Subject: Problem using bean:define tag File: ATT44709.txt Hi, I am getting a error while using bean:define tag ( Struts 1.1).Here is the code snippets. Action class: Setting value in the request attribute request.setAttribute( field1, countryCode); Jsp: %@ page language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html:html locale=true bean:define id=fieldxyz name=field1 / %= fieldxyz % /html:html Jsp is not getting compiled. Kindly provide me solution Regards Saravanan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL bean:define copy translation
Try c:set var=myVar%=JemosConstants.DATA_ %/c:set c:set var=userBean value=${sessionScope[myVar]}/ Adam On 09/17/2003 08:02 PM seloha . wrote: From: seloha . [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JSTL bean:define copy translation Date: Tue, 16 Sep 2003 12:26:02 +0100 I am using struts-el and trying to translate the following bean:define (i.e. copy an existing bean) into JSTL with no success: bean:define id=userBean name='%= JemosConstants.DATA_USER_DATA %' type=org.jemos.core.framework.ejbs.valueobject.PeopleValue / JemosConstants.DATA_USER_DATA is a session object. The form bean is an org.apache.struts.validator.DynaValidatorForm. Any help appreciated, Thanks Paul _ Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Solution: c:set var=userBean value=${sessionScope.DATA_USER_DATA} / may need to change scope (e.g. requestScope, etc.) accordingly _ Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- struts 1.1 + tomcat 4.1.27 + java 1.4.2 Linux 2.4.20 RH9 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL bean:define copy translation
From: seloha . [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: JSTL bean:define copy translation Date: Tue, 16 Sep 2003 12:26:02 +0100 I am using struts-el and trying to translate the following bean:define (i.e. copy an existing bean) into JSTL with no success: bean:define id=userBean name='%= JemosConstants.DATA_USER_DATA %' type=org.jemos.core.framework.ejbs.valueobject.PeopleValue / JemosConstants.DATA_USER_DATA is a session object. The form bean is an org.apache.struts.validator.DynaValidatorForm. Any help appreciated, Thanks Paul _ Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Solution: c:set var=userBean value=${sessionScope.DATA_USER_DATA} / may need to change scope (e.g. requestScope, etc.) accordingly _ Tired of 56k? Get a FREE BT Broadband connection http://www.msn.co.uk/specials/btbroadband - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
JSTL bean:define copy translation
I am using struts-el and trying to translate the following bean:define (i.e. copy an existing bean) into JSTL with no success: bean:define id=userBean name='%= JemosConstants.DATA_USER_DATA %' type=org.jemos.core.framework.ejbs.valueobject.PeopleValue / JemosConstants.DATA_USER_DATA is a session object. The form bean is an org.apache.struts.validator.DynaValidatorForm. Any help appreciated, Thanks Paul _ Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with logic:equal is actually a problem with bean:define and Weblogic 8.1
I tried just running bean:define id=username name=UserContainer property=user.username / Test: %= username % in a jsp file under Tomcat and that works ok, but doing the same under Weblogic 8.1 with SP 1, generates a cannot resolve symbol error. Is this a bug in WL or am I doing something wrong? BTJ On Sun, 2003-09-14 at 13:46, Bjørn T Johansen wrote: I have this code in my jsp page: logic:iterate id=elem name=annList tr logic:equal name=elem property=status value=0 td class=text bean:write name=elem property=annCreated //td td class=text bean:write name=elem property=filnavn //td td class=text html:radio property=checked idName=elem value=annID//td /logic:equal logic:equal name=elem property=status value=10 bean:define id=username name=UserContainer scope=session property=user.username / logic:equal name=elem property=caseworker value=%= (String) username % td class=text bean:write name=elem property=annCreated //td td class=text bean:write name=elem property=filnavn //td td class=text html:radio property=checked idName=elem value=annID//td /logic:equal logic:notEqual name=elem property=caseworker value=%= (String) username % td class=textdis bean:write name=elem property=annCreated //td td class=textdis bean:write name=elem property=filnavn //td td class=textdis bean:write name=elem property=caseworker //td /logic:notEqual /logic:equal /tr /logic:iterate But this just gives me an error message telling me that cannot resolve symbol symbol : variable username But this variable has been defined, hasn't it?? Any suggestions? Regards, BTJ
RE: Compile Error for bean:define
It _may_ be, and I'm just shooting in the dark here, that it's defined by default someplace other than as a local variable (like in the request). Try adding scope=page to the bean:define and see if that makes any difference. HTH, Carey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, September 05, 2003 11:11 PM To: [EMAIL PROTECTED] Subject: Compile Error for bean:define I am using bean:define tag in my jsp pages as bean:define id=actionValue name=GLPMUserAdminForm property=actionValue type=java.lang.String / html:form method=POST action='%=actionValue%' but when I run my application, I got compile error message that actionValue couldn't be solved in line html:form method=POST action='%=actionValue%'. Can anybody give me a hand?? 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]
Compile Error for bean:define
I am using bean:define tag in my jsp pages as bean:define id=actionValue name=GLPMUserAdminForm property=actionValue type=java.lang.String / html:form method=POST action='%=actionValue%' but when I run my application, I got compile error message that actionValue couldn't be solved in line html:form method=POST action='%=actionValue%'. Can anybody give me a hand?? Thanks. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:message in bean:define tag
Hi All, I am using the code snippet given below to define a variable for which the value is coming from property file by key 'home.mouseover.runbutton.caption'. But when i try to display ths jsp containing this snippet , i get java script error as struts doesn't compile bean:message key=home.mouseover.runbutton.caption/ and assign this string literal as it is to the defined variable. Please let me know what can be done to assign the actual value in property file to runcapt variable. jsp page = bean :define id=runcapt value=bean:message key=home.mouseover.runbutton.caption// === property file == home.mouseover.runbutton.caption = Run Search = Thanks in advance Shailesh Modi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:message in bean:define tag
HI, bean :define id="runcapt" bean:message key=home.mouseover.runbutton.caption/ /bean:define ---Original Message--- From: Struts Users Mailing List Date: Monday, September 01, 2003 06:04:31 PM To: [EMAIL PROTECTED] Subject: bean:message in bean:define tag Hi All,I am using the code snippet given below to define a variable for which thevalue is coming from property file by key'home.mouseover.runbutton.caption'.But when i try to display ths jsp containing this snippet , i get javascript error as struts doesn't compile "bean:messagekey=home.mouseover.runbutton.caption/" and assign this string literal as itis to the defined variable.Please let me know what can be done to assign the actual value in propertyfile to runcapt variable.jsp page=bean :define id="runcapt" value="bean:messagekey=home.mouseover.runbutton.caption/"/===property file==home.mouseover.runbutton.caption = Run Search=Thanks in advanceShailesh Modi-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]. IncrediMail - Email has finally evolved - Click Here
RE: bean:message in bean:define tag
Hi Nagendra, If we use this then error occurs , message is: javax.servlet.ServletException: Body is supposed to be empty for bean:define -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: Monday, September 01, 2003 6:20 PM To: [EMAIL PROTECTED] Subject: Re: bean:message in bean:define tag HI, bean :define id=runcapt bean:message key=home.mouseover.runbutton.caption/ /bean:define ---Original Message--- From: Struts Users Mailing List Date: Monday, September 01, 2003 06:04:31 PM To: [EMAIL PROTECTED] Subject: bean:message in bean:define tag Hi All, I am using the code snippet given below to define a variable for which the value is coming from property file by key 'home.mouseover.runbutton.caption'. But when i try to display ths jsp containing this snippet , i get java script error as struts doesn't compile bean:message key=home.mouseover.runbutton.caption/ and assign this string literal as it is to the defined variable. Please let me know what can be done to assign the actual value in property file to runcapt variable. jsp page = bean :define id=runcapt value=bean:message key=home.mouseover.runbutton.caption// === property file == home.mouseover.runbutton.caption = Run Search = Thanks in advance Shailesh Modi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] . IncrediMail - Email has finally evolved - Click Here
RE: bean:message in bean:define tag
okay, u got to upgrade to struts1.1 to make that working. struts1.0 does't any solution ur problem -- nagi ---Original Message--- From: Struts Users Mailing List Date: Monday, September 01, 2003 06:22:50 PM To: 'Struts Users Mailing List'; 'Nagendra Kumar O V S' Subject: RE: bean:message in bean:define tag Hi Nagendra,If we use this then error occurs , message is:javax.servlet.ServletException: Body is supposed to be empty forbean:define-Original Message-From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED]]Sent: Monday, September 01, 2003 6:20 PMTo: [EMAIL PROTECTED]Subject: Re: bean:message in bean:define tagHI,bean :define id="runcapt"bean:message key=home.mouseover.runbutton.caption//bean:define---Original Message---From: Struts Users Mailing ListDate: Monday, September 01, 2003 06:04:31 PMTo: [EMAIL PROTECTED]Subject: bean:message in bean:define tagHi All,I am using the code snippet given below to define a variable forwhich thevalue is coming from property file by key'home.mouseover.runbutton.caption'.But when i try to display ths jsp containing this snippet , i getjavascript error as struts doesn't compile "bean:messagekey=home.mouseover.runbutton.caption/" and assign this stringliteral as itis to the defined variable.Please let me know what can be done to assign the actual value inpropertyfile to runcapt variable.jsp page=bean :define id="runcapt" value="bean:messagekey=home.mouseover.runbutton.caption/"/===property file==home.mouseover.runbutton.caption = Run Search=Thanks in advanceShailesh Modi-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED].IncrediMail - Email has finally evolved - Click Here IncrediMail - Email has finally evolved - Click Here
bean:define primitive type?
Is there any way to have a primitive type be defined by a bean:define tag? The following does not work. bean:define id=catSelected name=form.admin.category property=selected type=int/ neither does bean:define id=catSelected name=form.admin.category property=selected type=java.lang.Integer.TYPE/ Any suggestions? Do I have to wrap this in an Integer? Thanks. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define primitive type?
I apologize. I searched exactly too little. Retrieve the value of a specified bean property, and define it as an attribute (in the scope specified by the toScope property) accessible to the remainder of the current page. No type conversion is performed on the returned property value, unless it is a Java primitive type, in which case it is wrapped in the appropriate wrapper class (i.e. int is wrapped by java.lang.Integer). Lukas Bradley [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Is there any way to have a primitive type be defined by a bean:define tag? The following does not work. bean:define id=catSelected name=form.admin.category property=selected type=int/ neither does bean:define id=catSelected name=form.admin.category property=selected type=java.lang.Integer.TYPE/ Any suggestions? Do I have to wrap this in an Integer? Thanks. Lukas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define primitive type?
On Sat, 16 Aug 2003, Lukas Bradley wrote: Date: Sat, 16 Aug 2003 22:26:20 -0400 From: Lukas Bradley [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: bean:define primitive type? Is there any way to have a primitive type be defined by a bean:define tag? The following does not work. bean:define id=catSelected name=form.admin.category property=selected type=int/ neither does bean:define id=catSelected name=form.admin.category property=selected type=java.lang.Integer.TYPE/ Any suggestions? Do I have to wrap this in an Integer? Thanks. Yes, you have to wrap. Primitives cannot be stored in request, session, or application scope -- ony objects. You should be able to just say: bean:define id=catSelected name=form.admin.category property=selected type=java.lang.Integer/ Lukas Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
logic:iterate and bean:define
Hi all. I have a requirement to check and validate values of the object which is been iterated inside the iterator tag. (i.e) i need to get two object and see whether it has any duplicate elements. problem i'm facing is that within a single iteration how to get the first second object in the iterator tag. just wanted to know wether this is possible using bean define tag. If so, how to do it. i know that this can be done using scriplets but just wanted to try if the same thing can be done using taglib. any help in this is appreciated. Thanx in advance regards sasi - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:iterate and bean:define
Is it possible that this is done in your business logic layer before you present the bean (from whatever scope) to the iterator tag ? Thamarajah Dharma wrote: Hi all. I have a requirement to check and validate values of the object which is been iterated inside the iterator tag. (i.e) i need to get two object and see whether it has any duplicate elements. problem i'm facing is that within a single iteration how to get the first second object in the iterator tag. just wanted to know wether this is possible using bean define tag. If so, how to do it. i know that this can be done using scriplets but just wanted to try if the same thing can be done using taglib. any help in this is appreciated. Thanx in advance regards sasi - 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]
Newbie problem with bean:define ...
Hi All, I needed help in clarifying what the following line of code would mean to a struts application bean:define name=appContext scope=session type=logic.AppContext id=app2 toScope=session / a) Try to find a object of the type logic.AppContext in the session scope called appContext b) Name the instance retrieved as app2 c) If the object is not found create one and save it to the session scope ( toScope ) regards Rupinder - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using the bean:define to store a bean:message value
Hello all, I was looking for a solution to a problem where within a JSP page I need to store a message (that I can obtain from bean:message tag) in a string for later use. I tried the example below with the following values: bean:define id=schemaNamebean:message key=db.schema//bean:define But everytime I load the page I get the following exception: javax.servlet.ServletException: Define tag can contain only one of name attribute, value attribute, or body content Any thoughts? -Gp -Original Message- From: Nagendra Kumar O V S [mailto:[EMAIL PROTECTED] Sent: August 1, 2003 7:47 AM To: [EMAIL PROTECTED] Subject: Re: Using a key as an argument to bean:message hi, u can't send the key as the argument to the bean:message, though u might want to consider this bean:define id=realValue bean:message key=customer.label / /bean:define bean:message key=field.lookupbutton arg0=%=realLabel%/ -- nagi ---Original Message--- From: Struts Users Mailing List mailto:[EMAIL PROTECTED] Date: Friday, August 01, 2003 05:00:41 PM To: Struts Users Mailing List (E-mail) mailto:[EMAIL PROTECTED] Subject: Using a key as an argument to bean:message Hi, Has anyone got any ideas on how to use a message key as an argument in a bean:message call. e.g. bean:message key=field.lookupbutton arg0Key=customer.label/ At the moment I am using a scriptlet to access the message resources and assign the message for the argument to a page variable. e.g. % org.apache.struts.util.MessageResources messages = (org.apache.struts.util.MessageResources)request.getAttribute(org.apache.str uts.Globals.MESSAGES_KEY); String realLabel = messages.getMessage(customer.label); % bean:message key=field.lookupbutton arg0=%=realLabel%/ This works but is a bit messy. Note that both keys are actually dynamic and come from nested beans on the ActionForm - I can't just create a fixed composite message in my application.properties. thanks, Paul ** 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] . http://www.incredimail.com/redir.asp?ad_id=309lang=9 IncrediMail - Email has finally evolved - http://www.incredimail.com/redir.asp?ad_id=309lang=9 Click Here
RE: Newbie problem with bean:define ...
Thanks but read this already And No its not a TEST Question , just trying to see if bean:define ... Is can be used like jsp:useBean ... Regards Rupinder -Original Message- From: David Graham [mailto:[EMAIL PROTECTED] Sent: 05 August 2003 15:31 To: Struts Users Mailing List Subject: Re: Newbie problem with bean:define ... This looks suspiciously like a test question. I'll give you a hint: http://jakarta.apache.org/struts/userGuide/struts-bean.html#define David --- Rupinder Singh Mazara [EMAIL PROTECTED] wrote: Hi All, I needed help in clarifying what the following line of code would mean to a struts application bean:define name=appContext scope=session type=logic.AppContext id=app2 toScope=session / a) Try to find a object of the type logic.AppContext in the session scope called appContext b) Name the instance retrieved as app2 c) If the object is not found create one and save it to the session scope ( toScope ) regards Rupinder - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.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]
bean:define id to be dynamic
bean:define id=%=idValue% / I need to get the id value dynamically to declare a bean. It throws exception while parsing the JSP file. Is there any other solution to it? Panchasheel - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define
Hi, i get the following error message in my jsp and i don't really understand why: Define tag can contain only one of name attribute, value attribute, or body content Now i use two define tags in my jsp: bean:define id=groupname scope=pagebean:write name=groupForm property=groupname//bean:define and bean:define id=curUser name=usersit property=username scope=page / Any help would be appreciated. Thanks, Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define
Hi, You are using both name and id tag. I guess, this gives the error. Thanks, Pramod Today is the first day for the rest of your life Filip Polsakiewicz [EMAIL PROTECTED] To: Struts Users Mailinglist [EMAIL PROTECTED] noface.de cc: Subject: bean:define 06/27/2003 01:00 PM Please respond to Struts Users Mailing List Hi, i get the following error message in my jsp and i don't really understand why: Define tag can contain only one of name attribute, value attribute, or body content Now i use two define tags in my jsp: bean:define id=groupname scope=pagebean:write name=groupForm property=groupname//bean:define and bean:define id=curUser name=usersit property=username scope=page / Any help would be appreciated. Thanks, Filip - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This electronic mail message is intended solely for the named recipients and may contain confidential and proprietary business information of eFunds Corporation and all its subsidiaries. If you are not a named recipient, please notify the sender immediately. You may not disclose the contents to any other person; use this electronic mail message or its contents for any other purpose; or further store or copy its contents in any medium - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define
if groupForm.getGroupname() returns null (or ) your first bean:define will have no body content, and will so have no value to assign to the bean to create. Nico. Hi, i get the following error message in my jsp and i don't really understand why: Define tag can contain only one of name attribute, value attribute, or body content Now i use two define tags in my jsp: bean:define id=groupname scope=pagebean:write name=groupForm property=groupname//bean:define and bean:define id=curUser name=usersit property=username scope=page / Any help would be appreciated. Thanks, Filip - 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: bean:define
-Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Friday, June 27, 2003 9:34 AM To: Struts Users Mailing List Subject: Re: bean:define if groupForm.getGroupname() returns null (or ) your first bean:define will have no body content, and will so have no value to assign to the bean to create. Thanks. That sould be it. Since i use the same JSP for creating and changing groups. Changing works fine because there is a groupId already. Nico. Hi, i get the following error message in my jsp and i don't really understand why: Define tag can contain only one of name attribute, value attribute, or body content Now i use two define tags in my jsp: bean:define id=groupname scope=pagebean:write name=groupForm property=groupname//bean:define and bean:define id=curUser name=usersit property=username scope=page / Any help would be appreciated. Thanks, Filip -- -- - 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]
bean:define to assign a different value to an existing variable
Apologies for the x-post, I put this in the dev newsgroup by a mistake. Ben In this code excerpt I am defining a bean with bean:define. However, I want to conditionally change the value. According to the struts doc, bean:define either creates, or replaces a previous instance of the bean as defined by the id. However, I can't see how this is possible, as the bean:define actually writes inline java i.e bean:define name=blah id=blah/ -- Object blah = ; logic:iterate name=page_of_results indexId=index id=thread bean:define scope=page name=hot_topic value=false id=hot_topic/ logic:greaterThan name=thread property=replyCount value=100 bean:define scope=page name=hot_topic value=true id=hot_topic/ /logic:greaterThan . .. logic:equal name=hot_topic value=true img src=/midletsite/images/hot_topic.gif/ /logic:equal /logic:iterate I've tried replacing the other bean:defines with scriptlets eg, logic:greaterThan name=thread property=replyCount value=100 %hot_topic=false% /logic:greaterThan but the bean:write later on seems to have ignored the scriptlet ( possibly due to the compilation order of the JSP vs. tags? Can anyone provide a workaround? Thanks Ben
Re: bean:define to assign a different value to an existing variable
I don't think you can have it twice on the same page. You will have to try another way. sandeep --- [EMAIL PROTECTED] wrote: Apologies for the x-post, I put this in the dev newsgroup by a mistake. Ben In this code excerpt I am defining a bean with bean:define. However, I want to conditionally change the value. According to the struts doc, bean:define either creates, or replaces a previous instance of the bean as defined by the id. However, I can't see how this is possible, as the bean:define actually writes inline java i.e bean:define name=blah id=blah/ -- Object blah = ; logic:iterate name=page_of_results indexId=index id=thread bean:define scope=page name=hot_topic value=false id=hot_topic/ logic:greaterThan name=thread property=replyCount value=100 bean:define scope=page name=hot_topic value=true id=hot_topic/ /logic:greaterThan . .. logic:equal name=hot_topic value=true img src=/midletsite/images/hot_topic.gif/ /logic:equal /logic:iterate I've tried replacing the other bean:defines with scriptlets eg, logic:greaterThan name=thread property=replyCount value=100 %hot_topic=false% /logic:greaterThan but the bean:write later on seems to have ignored the scriptlet ( possibly due to the compilation order of the JSP vs. tags? Can anyone provide a workaround? Thanks Ben __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define to assign a different value to an existing variable
Hi James, So what does the name portion of the bean:define actually do ( I've done the RTFM but I'm still confused ). Is the name the name of the value in pageContext() and id the scripting value on the jsp page? Thanks Ben James Mitchell [EMAIL PROTECTED] 27/06/2003 11:55 Please respond to Struts Developers List To: Struts Developers List [EMAIL PROTECTED] cc: Subject:Re: bean:define to assign a different value to an existing variable Oh, I also noticed that you are asking user questions on the dev list. Move this thread over to the users list please. On Friday 27 June 2003 05:37, [EMAIL PROTECTED] wrote: In this code excerpt I am defining a bean with bean:define. However, I want to conditionally change the value. According to the struts doc, bean:define either creates, or replaces a previous instance of the bean as defined by the id. However, I can't see how this is possible, as the bean:define actually writes inline java i.e bean:define name=blah id=blah/ -- Object blah = ; logic:iterate name=page_of_results indexId=index id=thread bean:define scope=page name=hot_topic value=false id=hot_topic/ logic:greaterThan name=thread property=replyCount value=100 bean:define scope=page name=hot_topic value=true id=hot_topic/ /logic:greaterThan . .. logic:equal name=hot_topic value=true img src=/midletsite/images/hot_topic.gif/ /logic:equal /logic:iterate I've tried replacing the other bean:defines with scriptlets eg, logic:greaterThan name=thread property=replyCount value=100 %hot_topic=false% /logic:greaterThan but the bean:write later on seems to have ignored the scriptlet ( possibly due to the compilation order of the JSP vs. tags? Can anyone provide a workaround? Thanks Ben -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define to assign a different value to an existing variable
On Friday 27 June 2003 09:26, [EMAIL PROTECTED] wrote: Hi James, So what does the name portion of the bean:define actually do ( I've done the RTFM but I'm still confused ). Is the name the name of the value in pageContext() and id the scripting value on the jsp page? I know, the docs can be a little intimidating. Here's (more or less) what you've provided us: logic:iterate id=thread name=page_of_results indexId=index bean:define id=hot_topic name=hot_topic value=false / logic:greaterThan name=thread property=replyCount value=100 bean:define id=hot_topic name=hot_topic value=true/ /logic:greaterThan logic:equal name=hot_topic value=true img src=/midletsite/images/hot_topic.gif/ /logic:equal /logic:iterate From this I am assuming: - You are iterating over a collection of beans. (I'll call them TopicBeans for now.) - You've placed this collection in the request (or some scope) under the name page_of_results. Now you want to know if the number of replies to that thread are greater than 100 (thread.getReplyCount() 100) If so, then show the hot_topic.gif icon. Am I on target so far? If so, first thing I would do is pull that logic out of the tags. Hell, pull it out of the page altogether. Make this configurable via the bundle. Add a boolean to your bean isHotTopic. In your action, check to see if the number of threads is greater than 100 (or some parsed value from your properties file). So you should be able to do this: logic:iterate id=thread name=page_of_results indexId=index logic:equal name=thread property=hotTopic value=true html:img page=/images/hot_topic.gif/ /logic:equal /logic:iterate Thanks Ben BTW. I also fixed your image tag, you should never hard-code your application's context in your pages. -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define to assign a different value to an existing variable
Thanks James, Thanks for the tips, I'm really trying to do things the right way! -b James Mitchell [EMAIL PROTECTED] 27/06/2003 14:58 Please respond to Struts Users Mailing List To: Struts Users Mailing List [EMAIL PROTECTED] cc: Subject:Re: bean:define to assign a different value to an existing variable On Friday 27 June 2003 09:26, [EMAIL PROTECTED] wrote: Hi James, So what does the name portion of the bean:define actually do ( I've done the RTFM but I'm still confused ). Is the name the name of the value in pageContext() and id the scripting value on the jsp page? I know, the docs can be a little intimidating. Here's (more or less) what you've provided us: logic:iterate id=thread name=page_of_results indexId=index bean:define id=hot_topic name=hot_topic value=false / logic:greaterThan name=thread property=replyCount value=100 bean:define id=hot_topic name=hot_topic value=true/ /logic:greaterThan logic:equal name=hot_topic value=true img src=/midletsite/images/hot_topic.gif/ /logic:equal /logic:iterate From this I am assuming: - You are iterating over a collection of beans. (I'll call them TopicBeans for now.) - You've placed this collection in the request (or some scope) under the name page_of_results. Now you want to know if the number of replies to that thread are greater than 100 (thread.getReplyCount() 100) If so, then show the hot_topic.gif icon. Am I on target so far? If so, first thing I would do is pull that logic out of the tags. Hell, pull it out of the page altogether. Make this configurable via the bundle. Add a boolean to your bean isHotTopic. In your action, check to see if the number of threads is greater than 100 (or some parsed value from your properties file). So you should be able to do this: logic:iterate id=thread name=page_of_results indexId=index logic:equal name=thread property=hotTopic value=true html:img page=/images/hot_topic.gif/ /logic:equal /logic:iterate Thanks Ben BTW. I also fixed your image tag, you should never hard-code your application's context in your pages. -- James Mitchell Software Developer/Struts Evangelist http://www.struts-atlanta.org 770-822-3359 AIM:jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define and JSP 1.1 restriction
Hi all, I can read in struts-bean doc this usage note for bean:define tag : There is a restriction in the JSP 1.1 Specification that disallows using the same value for an id attribute more than once in a single JSP page. Therefore, you will not be able to use bean:define for the same bean name more than once in a single page. Some of my JSPs use bean:define to compute a boolean value from other datas that is use in a logic tag later in JSP. It looks like this : bean:define id=dolink value=false/ logic:equal bean:define id=dolink value=true/ /logic:equal This code works fine on tomcat 4.1.24 and weblogic 6.1 SP5. Reading the usage note, it should not work according to JSP 1.1 spec. Someone in my team uses tomcat 4.0.6 and got errors with this mutliple bean:define. - Does JSP 1.2 has this restriction to ? - Do you think I should upgrade my JSP to be JSP 1.1 compliant, assuming it works fine on target container (Weblogic) - How to avoid using multiple times the same id (Do I need to build a custiom tag ?) Nico. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define in weblogic 6.1 SP5
Hi all, I got some troubles with Struts bean:define tag on Weblogic 6.10 SP5 : In generated java code for JSP no script variable is defined for bean:define tags (it works well on tomcat). for example bean:define id=doLink value=false type=String/ doesn't declare a String doLink local variable in generated java (and I get some errors when using %= doLink % as another tag attribute). In the same JSP I use tile:useAttribute and bean:struts and it works well (local variable is declared in generated java code). Any suggestion ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define in weblogic 6.1 SP5
As extra info, it works fine on Weblogic 6.1 SP3. It looks like a WLS bug. Nico. Hi all, I got some troubles with Struts bean:define tag on Weblogic 6.10 SP5 : In generated java code for JSP no script variable is defined for bean:define tags (it works well on tomcat). for example bean:define id=doLink value=false type=String/ doesn't declare a String doLink local variable in generated java (and I get some errors when using %= doLink % as another tag attribute). In the same JSP I use tile:useAttribute and bean:struts and it works well (local variable is declared in generated java code). Any suggestion ? - 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: bean:define in weblogic 6.1 SP5
hmmm, looks like we both are having the same problems with bean:define in WLS 6.1 sp5. I posted about my problem on Friday titled: problem with bean:define and wls 6.1 sp5 when using include. Same situation as you in that after the define the script variable is not accessible. (I didn't have my problem with SP4, and I don't have my problem on Jboss/Tomcat either). I am thinking it is a SP5 bug, I am going to try and contact BEA today. - Jim Piper -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 4:58 AM To: Struts Users Mailing List Subject: Re: bean:define in weblogic 6.1 SP5 As extra info, it works fine on Weblogic 6.1 SP3. It looks like a WLS bug. Nico. Hi all, I got some troubles with Struts bean:define tag on Weblogic 6.10 SP5 : In generated java code for JSP no script variable is defined for bean:define tags (it works well on tomcat). for example bean:define id=doLink value=false type=String/ doesn't declare a String doLink local variable in generated java (and I get some errors when using %= doLink % as another tag attribute). In the same JSP I use tile:useAttribute and bean:struts and it works well (local variable is declared in generated java code). Any suggestion ? - 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: bean:define in weblogic 6.1 SP5
This WLS bug seems to be solved by patch CR105772. We recieved it from BEA ant are curretly testing it on our application. I can send it to you if you need (have no doc about what bug(s) is corrected) Nico. hmmm, looks like we both are having the same problems with bean:define in WLS 6.1 sp5. I posted about my problem on Friday titled: problem with bean:define and wls 6.1 sp5 when using include. Same situation as you in that after the define the script variable is not accessible. (I didn't have my problem with SP4, and I don't have my problem on Jboss/Tomcat either). I am thinking it is a SP5 bug, I am going to try and contact BEA today. - Jim Piper -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED] Sent: Monday, June 23, 2003 4:58 AM To: Struts Users Mailing List Subject: Re: bean:define in weblogic 6.1 SP5 As extra info, it works fine on Weblogic 6.1 SP3. It looks like a WLS bug. Nico. Hi all, I got some troubles with Struts bean:define tag on Weblogic 6.10 SP5 : In generated java code for JSP no script variable is defined for bean:define tags (it works well on tomcat). for example bean:define id=doLink value=false type=String/ doesn't declare a String doLink local variable in generated java (and I get some errors when using %= doLink % as another tag attribute). In the same JSP I use tile:useAttribute and bean:struts and it works well (local variable is declared in generated java code). Any suggestion ? - 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]
problem with bean:define and wls 6.1 sp5 when using include
I am having a problem with bean:define and wls 6.1 sp5 when using it from a %@ include % code. I don't have this problem with sp4. For example here is a simple test case (this code works on WebLogic 6.1 SP4, but it does not work on WebLogic 6.1 SP5): FILE NAMED: wlstest.jsp %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html head titlewlstest/title /head body On the first page: this is a testbr %@ include file=wlstest2.jsp % /body /html FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ On the second page: %= myMessage %br With SP5 I get an error that: /opt/home/weblogic/bea/wlserver6.1/config/SCRO/applications/.wlnotdelete/wla p22883/WEB-INF/_tmp_war_SCRO_Server_SCRO_SCRO-WAR-0.1-dev/jsp_servlet/__wlst est.java:118: Undefined variable: myMessage probably occurred due to an error in /wlstest2.jsp line 2: On the second page: %= myMessage %br It looks to me like SP5 allows me to use my struts-bean.tld that was defined in the outer jsp, but when I try to use that bean:define tag from the inner jsp then it is as if the scripting variable that it sets is not accessible from the inner jsp. Just as a curiosity if I add a jsp:useBean to the inner JSP as shown in the following, then it works fine on SP5, but fails on SP4: FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ jsp:useBean id=myMessage class=java.lang.String / On the second page: %= myMessage %br With SP4 that jsp:useBean will result in what to me is the expected error: /wlstest.jsp(2): a variable named myMessage was previously declared at line 1 of /wlstest2.jsp probably occurred due to an error in /wlstest.jsp line 2: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % This is bugging me because I used the %@ include quite a bit in my code and now that we are trying to move to SP5 it is all screwy. I know I could go through and instead use jsp:include but I don't want to if I don't have to. Anybody have any ideas? Am I missing something? is sp5 missing something? - Jim Piper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: problem with bean:define and wls 6.1 sp5 when using include
should use toScope=request I think. sandeep --- Piper, James D CECOM SEC EPS [EMAIL PROTECTED] wrote: I am having a problem with bean:define and wls 6.1 sp5 when using it from a %@ include % code. I don't have this problem with sp4. For example here is a simple test case (this code works on WebLogic 6.1 SP4, but it does not work on WebLogic 6.1 SP5): FILE NAMED: wlstest.jsp %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html head titlewlstest/title /head body On the first page: this is a testbr %@ include file=wlstest2.jsp % /body /html FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ On the second page: %= myMessage %br With SP5 I get an error that: /opt/home/weblogic/bea/wlserver6.1/config/SCRO/applications/.wlnotdelete/wla p22883/WEB-INF/_tmp_war_SCRO_Server_SCRO_SCRO-WAR-0.1-dev/jsp_servlet/__wlst est.java:118: Undefined variable: myMessage probably occurred due to an error in /wlstest2.jsp line 2: On the second page: %= myMessage %br It looks to me like SP5 allows me to use my struts-bean.tld that was defined in the outer jsp, but when I try to use that bean:define tag from the inner jsp then it is as if the scripting variable that it sets is not accessible from the inner jsp. Just as a curiosity if I add a jsp:useBean to the inner JSP as shown in the following, then it works fine on SP5, but fails on SP4: FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ jsp:useBean id=myMessage class=java.lang.String / On the second page: %= myMessage %br With SP4 that jsp:useBean will result in what to me is the expected error: /wlstest.jsp(2): a variable named myMessage was previously declared at line 1 of /wlstest2.jsp probably occurred due to an error in /wlstest.jsp line 2: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % This is bugging me because I used the %@ include quite a bit in my code and now that we are trying to move to SP5 it is all screwy. I know I could go through and instead use jsp:include but I don't want to if I don't have to. Anybody have any ideas? Am I missing something? is sp5 missing something? - Jim Piper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: problem with bean:define and wls 6.1 sp5 when using include
Hmmm, that doesn't seem to work either. I changed the bean:define in the second test file to be: FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String toScope=request / On the second page: %= myMessage %br and got the same error as before. - Jim Piper -Original Message- From: Sandeep Takhar [mailto:[EMAIL PROTECTED] Sent: Friday, June 20, 2003 2:28 PM To: Struts Users Mailing List Subject: Re: problem with bean:define and wls 6.1 sp5 when using include should use toScope=request I think. sandeep --- Piper, James D CECOM SEC EPS [EMAIL PROTECTED] wrote: I am having a problem with bean:define and wls 6.1 sp5 when using it from a %@ include % code. I don't have this problem with sp4. For example here is a simple test case (this code works on WebLogic 6.1 SP4, but it does not work on WebLogic 6.1 SP5): FILE NAMED: wlstest.jsp %@ page language=java % %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % html head titlewlstest/title /head body On the first page: this is a testbr %@ include file=wlstest2.jsp % /body /html FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ On the second page: %= myMessage %br With SP5 I get an error that: /opt/home/weblogic/bea/wlserver6.1/config/SCRO/applications/.wlnotdelete/wla p22883/WEB-INF/_tmp_war_SCRO_Server_SCRO_SCRO-WAR-0.1-dev/jsp_servlet/__wlst est.java:118: Undefined variable: myMessage probably occurred due to an error in /wlstest2.jsp line 2: On the second page: %= myMessage %br It looks to me like SP5 allows me to use my struts-bean.tld that was defined in the outer jsp, but when I try to use that bean:define tag from the inner jsp then it is as if the scripting variable that it sets is not accessible from the inner jsp. Just as a curiosity if I add a jsp:useBean to the inner JSP as shown in the following, then it works fine on SP5, but fails on SP4: FILE NAMED: wlstest2.jsp bean:define id=myMessage value=this is another test type=java.lang.String/ jsp:useBean id=myMessage class=java.lang.String / On the second page: %= myMessage %br With SP4 that jsp:useBean will result in what to me is the expected error: /wlstest.jsp(2): a variable named myMessage was previously declared at line 1 of /wlstest2.jsp probably occurred due to an error in /wlstest.jsp line 2: %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean % This is bugging me because I used the %@ include quite a bit in my code and now that we are trying to move to SP5 it is all screwy. I know I could go through and instead use jsp:include but I don't want to if I don't have to. Anybody have any ideas? Am I missing something? is sp5 missing something? - Jim Piper - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define error
here is the code, I have FELLOW_HEADER in session, it gives the following error [ServletException in:/jsp/fellow/declare_tenure_plans_step_1_1_tile.jsp] Define tag can contain only one of name attribute, value attribute, or body content' I'm using JRun4.0 bean:define id=header name=FELLOW_HEADER/ bean:define id=fCode bean:write name=header property=fosCode/ /bean:define html:select property=fosCode value=%=fCode% html:options collection=FIELD_OF_STUDY_CODES property=code labelProperty=description / /html:select Thanks, Anand _ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Too many bean:define tags
In a couple of my JSPs I currently define properties from my ApplicationResouces.properties file like this ... bean:define id=priorityHeading bean:message key=priority.heading/ /bean:define Which is then used for column headings and such in my display like this ... display:column property=priority title=%= priorityHeading %/ The problem is that I have *so* many bean:define tags, and my resulting .java files are huge. I would like to pull out these bean:defines and put this definition code somewhere else, outside my JSPs. Is my only option to add all the definitions as properties to my ActionForm, then populate them in the Action with the something like ... MessageResouces messages = getResouces(request); myForm.setPriorityHeading(messages.getMessage(priority.heading)); This will add quite a bit of code to my Action. Is there a way to access the ApplicationResources.properties file in an ActionForm? Then perhaps I could set these values within a form bean instead? Perhaps I have made this way too difficult from the beginning? Thank you, Susan Bradeen [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: A bean:define question
snip/ I've always been confused by people who ask things like, Does IDE X support JSP debugging?. Well, if you need to debug your JSP, you've got way too much logic in there and no IDE will save you. Not necessarily. JSP debugging is definitely handy when you are working with a not-yet-mature tag library. I have -- on more than one occasion -- found the bug to be in the tag than in the application logic. In lieu of JSP debugging, I use the generated Java code to debug; definitely more tedious -- but it works. David Sri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: A bean:define question
-Original Message- From: Gemes Tibor [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 9:09 AM To: Struts Users Mailing List Subject: Re: [OT] Re: A bean:define question Sri Sankaran írta: JSP debugging is definitely handy when you are working with a not-yet-mature tag library. I have -- on more than one occasion -- found the bug to be in the tag than in the application logic. I prefer using unit test cases for this purpose... You mean unit test cases for the tags? Sure. But these aren't tags *I* have developed. Tib Sri - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: A bean:define question
On Wed, 2 Apr 2003, Affan Qureshi wrote: Date: Wed, 2 Apr 2003 08:36:31 +0500 From: Affan Qureshi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [OT] Re: A bean:define question Isn't the scriplet free version more confusing/cryptic than the scriplet one? I know we should avoid scriplets 110% in JSPs but what about cases where it can save some confusion of five tags to do a simple thing? The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. Intersted to know your comments. It's not just the page author you should be worrying about -- the page compiler is affected as well. Pages with no scriptlets allow the compiler to create much better executable code (including lifting the 64k limit on method size that really affects pages with lots of custom tags). Personally, I prefer the JSTL syntax for stuff like this: c:set var=varName value=${requestScope.httpParameter}/ Regards, Affan Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: A bean:define question
I found sometimes it is hard to use one-line JSTL code in a situation like this - iterate through a list. - if odd line, use style oddTableRowStyle - if even line, use style evenTableRowStyle e.g. logic:iterate name=myBean property=myCollection id=myLineItem TR id=myStyle TD../TD /TR /logic:iterate How do I fill in this myStyle to serve the above purpose? Just a quiz, don't take it seriously. Regards -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: April 2, 2003 12:18 PM To: Struts Users Mailing List Subject: Re: [OT] Re: A bean:define question On Wed, 2 Apr 2003, Affan Qureshi wrote: Date: Wed, 2 Apr 2003 08:36:31 +0500 From: Affan Qureshi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [OT] Re: A bean:define question Isn't the scriplet free version more confusing/cryptic than the scriplet one? I know we should avoid scriplets 110% in JSPs but what about cases where it can save some confusion of five tags to do a simple thing? The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. Intersted to know your comments. It's not just the page author you should be worrying about -- the page compiler is affected as well. Pages with no scriptlets allow the compiler to create much better executable code (including lifting the 64k limit on method size that really affects pages with lots of custom tags). Personally, I prefer the JSTL syntax for stuff like this: c:set var=varName value=${requestScope.httpParameter}/ Regards, Affan Craig - 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] Re: A bean:define question
You should be using a table row tag to perform that logic. David From: apachep2 [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Subject: RE: [OT] Re: A bean:define question Date: Wed, 2 Apr 2003 12:32:05 -0500 I found sometimes it is hard to use one-line JSTL code in a situation like this - iterate through a list. - if odd line, use style oddTableRowStyle - if even line, use style evenTableRowStyle e.g. logic:iterate name=myBean property=myCollection id=myLineItem TR id=myStyle TD../TD /TR /logic:iterate How do I fill in this myStyle to serve the above purpose? Just a quiz, don't take it seriously. Regards -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] Sent: April 2, 2003 12:18 PM To: Struts Users Mailing List Subject: Re: [OT] Re: A bean:define question On Wed, 2 Apr 2003, Affan Qureshi wrote: Date: Wed, 2 Apr 2003 08:36:31 +0500 From: Affan Qureshi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: [OT] Re: A bean:define question Isn't the scriplet free version more confusing/cryptic than the scriplet one? I know we should avoid scriplets 110% in JSPs but what about cases where it can save some confusion of five tags to do a simple thing? The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. Intersted to know your comments. It's not just the page author you should be worrying about -- the page compiler is affected as well. Pages with no scriptlets allow the compiler to create much better executable code (including lifting the 64k limit on method size that really affects pages with lots of custom tags). Personally, I prefer the JSTL syntax for stuff like this: c:set var=varName value=${requestScope.httpParameter}/ Regards, Affan Craig - 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] _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
A bean:define question
Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user Thx Mauro - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: A bean:define question
You will have to do something like this: % String key = request.getParameter(httpParameter) + .name; % bean:define id=varName bean:message key=%=key%.name/ /bean:define robert -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 11:09 AM To: Struts Users Mailing List Subject: A bean:define question Importance: High Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user Thx Mauro - 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: A bean:define question
This might work: bean:define id=varName bean:message key='%= request.getParameter(httpParameter) + .name %'/ /bean:define -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: A bean:define question
or using the scriptlet-free version bean:parameter id=myparam name=httpParameter/ bean:define id=msgKey bean:write name=myparam/.name /bean:define bean:define id=varName bean:message name=msgKey/ /bean:define bean:write name=varName/ -- remove this unless you just want to print it out on the page -- James Mitchell Software Developer/Struts Evangelist http://www.open-tools.org - Original Message - From: Karr, David [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 11:14 AM Subject: RE: A bean:define question This might work: bean:define id=varName bean:message key='%= request.getParameter(httpParameter) + .name %'/ /bean:define -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user - 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]
[OT] Re: A bean:define question
Isn't the scriplet free version more confusing/cryptic than the scriplet one? I know we should avoid scriplets 110% in JSPs but what about cases where it can save some confusion of five tags to do a simple thing? The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. Intersted to know your comments. Regards, Affan - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 12:21 AM Subject: Re: A bean:define question or using the scriptlet-free version bean:parameter id=myparam name=httpParameter/ bean:define id=msgKey bean:write name=myparam/.name /bean:define bean:define id=varName bean:message name=msgKey/ /bean:define bean:write name=varName/ -- remove this unless you just want to print it out on the page -- James Mitchell Software Developer/Struts Evangelist http://www.open-tools.org - Original Message - From: Karr, David [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 11:14 AM Subject: RE: A bean:define question This might work: bean:define id=varName bean:message key='%= request.getParameter(httpParameter) + .name %'/ /bean:define -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user - 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: [OT] Re: A bean:define question
On Tue, 2003-04-01 at 22:36, Affan Qureshi wrote: Isn't the scriplet free version more confusing/cryptic than the scriplet one? I know we should avoid scriplets 110% in JSPs but what about cases where it can save some confusion of five tags to do a simple thing? Well, first of all, referencing a key from the bundle like this is poor design IMHO. Something like that should have been done in the action, and placed on the formbean. I was just trying to help with syntax. The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. I agree. Intersted to know your comments. Regards, Affan - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 12:21 AM Subject: Re: A bean:define question or using the scriptlet-free version bean:parameter id=myparam name=httpParameter/ bean:define id=msgKey bean:write name=myparam/.name /bean:define bean:define id=varName bean:message name=msgKey/ /bean:define bean:write name=varName/ -- remove this unless you just want to print it out on the page -- James Mitchell Software Developer/Struts Evangelist http://www.open-tools.org - Original Message - From: Karr, David [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 11:14 AM Subject: RE: A bean:define question This might work: bean:define id=varName bean:message key='%= request.getParameter(httpParameter) + .name %'/ /bean:define -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Hi I have the user.name property in my ApplicationResource.properties file. Can I take its value with the following instrucition in my JSP page? bean:define id=varName bean:message key=%= request.getParameter(httpParameter) %.name/ /bean:define Of course, I call my JSP with this URI /myPage.jsp?httpParameter=user - 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] -- James Mitchell Software Developer/Struts Evangelist http://www.open-tools.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: A bean:define question
The reason to avoid scriplets is to allow seperation of page designers and developers dependancies but the poor page designer won't make much sense out of either of them in this case i think and its better to give him one line of confusion than 5. Ah, the mysterious page designer. They're rarely spotted in the Canadian woods...or is that the Yetti? I believe most developers don't have the luxury of dedicated page designers. IMO, the main reason to use tags over scriptlets is that it's more productive and much less error prone. I've always been confused by people who ask things like, Does IDE X support JSP debugging?. Well, if you need to debug your JSP, you've got way too much logic in there and no IDE will save you. David _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with casting resources aquired with bean:define/ tag
Hi! I've some problem with an int property value, read from my ApplicationResources file... This is my TAG in JSP page: bean:define id=readValue type=int bean:message key=read.this.property.from.file/ /bean:define but when I try to use the variable readValue, it seems to be a 'NULL' attribute... So I've just tryied this one TAG: bean:define id=readValue type=java.lang.Integer bean:message key=read.this.property.from.file/ /bean:define but when I use the method readValue.intValue() to convert this value to an int I receive the same error as before... Anybody knows why? Thx Mauro - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Question on bean:define
I've just upgraded my jdk to 1.4.1_02 version. Now, where I use (in JSP pages) the instruction: bean:define id=pathImages property=images.uri/ ...I receive the following error: javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:257) Somebidy knows the problem? :-( Thx Mauro -- ° Mauro L. Binaghi - Matrix S.p.A. ° Technology - Web Developer Coordinator ° e-mail: [EMAIL PROTECTED] ° Phone: +39 0229047.656 ° FAX: +39 0229047.564 ° C.so Garibaldi, 99 ° 20121 Milano, ITALY ° http://www.matrix.it/ ° http://www.seat.it/ ° http://www.virgilio.it/ -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Question on bean:define
In your case, I think the message isn't quite accurate. The message should say something like ... needs to contain EXACTLY one of You aren't using any of name, value, or body content. This has nothing to do with your JDK upgrade. -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 6:51 AM To: [EMAIL PROTECTED] Subject: Question on bean:define I've just upgraded my jdk to 1.4.1_02 version. Now, where I use (in JSP pages) the instruction: bean:define id=pathImages property=images.uri/ ...I receive the following error: javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:257) Somebidy knows the problem? :-( Thx Mauro -- ° Mauro L. Binaghi - Matrix S.p.A. ° Technology - Web Developer Coordinator ° e-mail: [EMAIL PROTECTED] ° Phone: +39 0229047.656 ° FAX: +39 0229047.564 ° C.so Garibaldi, 99 ° 20121 Milano, ITALY ° http://www.matrix.it/ ° http://www.seat.it/ ° http://www.virgilio.it/ -- - 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: Question on bean:define
Perfect. But I've tryied these also: 1) bean:define id=pathImages name=ApplicationResources property=images.uri/ 2) bean:define id=pathImages property=images.uri value=/images/ ...well, thw second one is right. But I want to read the attribute images.uri from my configuration file ApplicationResources.properties. How can I do? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: martedì 25 marzo 2003 17.57 To: Struts Users Mailing List Subject: RE: Question on bean:define In your case, I think the message isn't quite accurate. The message should say something like ... needs to contain EXACTLY one of You aren't using any of name, value, or body content. This has nothing to do with your JDK upgrade. -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 6:51 AM To: [EMAIL PROTECTED] Subject: Question on bean:define I've just upgraded my jdk to 1.4.1_02 version. Now, where I use (in JSP pages) the instruction: bean:define id=pathImages property=images.uri/ ...I receive the following error: javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:257) Somebidy knows the problem? :-( Thx Mauro -- ° Mauro L. Binaghi - Matrix S.p.A. ° Technology - Web Developer Coordinator ° e-mail: [EMAIL PROTECTED] ° Phone: +39 0229047.656 ° FAX: +39 0229047.564 ° C.so Garibaldi, 99 ° 20121 Milano, ITALY ° http://www.matrix.it/ ° http://www.seat.it/ ° http://www.virgilio.it/ -- - 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: Question on bean:define
On Tue, 2003-03-25 at 12:13, Binaghi Mauro wrote: Perfect. But I've tryied these also: 1) bean:define id=pathImages name=ApplicationResources property=images.uri/ 2) bean:define id=pathImages property=images.uri value=/images/ ...well, thw second one is right. But I want to read the attribute images.uri from my configuration file ApplicationResources.properties. How can I do? Have you opened the struts-example to see how its done? -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: marted 25 marzo 2003 17.57 To: Struts Users Mailing List Subject: RE: Question on bean:define In your case, I think the message isn't quite accurate. The message should say something like ... needs to contain EXACTLY one of You aren't using any of name, value, or body content. This has nothing to do with your JDK upgrade. -Original Message- From: Binaghi Mauro [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 25, 2003 6:51 AM To: [EMAIL PROTECTED] Subject: Question on bean:define I've just upgraded my jdk to 1.4.1_02 version. Now, where I use (in JSP pages) the instruction: bean:define id=pathImages property=images.uri/ ...I receive the following error: javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:257) Somebidy knows the problem? :-( Thx Mauro -- Mauro L. Binaghi - Matrix S.p.A. Technology - Web Developer Coordinator e-mail: [EMAIL PROTECTED] Phone: +39 0229047.656 FAX: +39 0229047.564 C.so Garibaldi, 99 20121 Milano, ITALY http://www.matrix.it/ http://www.seat.it/ http://www.virgilio.it/ -- - 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] -- James Mitchell Software Developer/Struts Evangelist http://www.open-tools.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define and el tags
Hi I am trying to use simple if-else logic here. Date formatter - jsp:useBean id=now class=java.util.Date / fmt:formatDate var=currentdate value=${now} pattern=dd/MM// If my indexed property in the form returns null, I use the current date. c:choose c:when test=${form.startDate[0] != null} bean:define id=date name=form property='%= startDate[ + 0 + ] %'/ /c:when c:when test=${form.startDate[0] == null} bean:define id=date value=%=currentdate%/ /c:when /c:choose This is to populate my html:text box like this html:text value=%=date.toString()% Is something wrong here ? It seems that the variable date is not found at runtime. Thanks, Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bean:define and el tags
Hi, Answering my own question. The code to check if an indexed property is null or not in Struts 1.0.2/JSTL seems to be so long. I am just using two date checks here. This seems to be so even if we use JSTL. I think that this type of logic is quite commonplace in web projects. Should it be so complex ? Am I making it so complex? It works anyway. !-- Get current date and format it appropriately -- jsp:useBean id=now class=java.util.Date / fmt:formatDate var=currentdate value=${now} pattern=dd/MM// !-- Use the variable once. Why doesn't JSTL above do that automatically ? -- jsp:useBean id=currentdate class=java.lang.String / !-- Declare two variables at the beginning. Why is type necessary here? These two variables are manipulated below. Why is this declaration necessary ? -- bean:define id=startdate value=%=currentdate% type=java.lang.Object/ bean:define id=enddate value=%=currentdate% type=java.lang.Object/ !-- The logic to check if the indexed property is null or not. If it is null, use the current date. -- c:choose c:when test=${reportForm.startDate[0] != null} bean:define id=startdate name=reportForm property='%= startDate[ + 0 + ]%'/ /c:when c:when test=${reportForm.startDate[0] == null} bean:define id=startdate value=%=currentdate.toString()%/ /c:when c:otherwise bean:define id=startdate value=%=currentdate.toString()%/ /c:otherwise /c:choose !-- The logic to check if the indexed property is null or not. If it is null, use the current date. -- c:choose c:when test=${reportForm.endDate[0] != null} bean:define id=enddate name=reportForm property='%= endDate[ + 0 + ] %'/ /c:when c:when test=${reportForm.endDate[0] == null} bean:define id=enddate value=%=currentdate.toString()%/ /c:when c:otherwise bean:define id=enddate value=%=currentdate.toString()%/ /c:otherwise /c:choose Mohan -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 2:07 PM To: 'Struts Users Mailing List' Subject: bean:define and el tags Hi I am trying to use simple if-else logic here. Date formatter - jsp:useBean id=now class=java.util.Date / fmt:formatDate var=currentdate value=${now} pattern=dd/MM// If my indexed property in the form returns null, I use the current date. c:choose c:when test=${form.startDate[0] != null} bean:define id=date name=form property='%= startDate[ + 0 + ] %'/ /c:when c:when test=${form.startDate[0] == null} bean:define id=date value=%=currentdate%/ /c:when /c:choose This is to populate my html:text box like this html:text value=%=date.toString()% Is something wrong here ? It seems that the variable date is not found at runtime. Thanks, Mohan - 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]
Struts bean:define tag questions
Ok, Imagine I have an object User (package test.UserVO) which contains another object Address (package test.AddressVO)which has a String property city. User and Address are both java beans. User has been placed in session scope as UserVO. How would I access the property city? I noticed that the bean:define tag has a copy feature which will copy a bean to a different scope. Could this feature be used here? Could you copy the nested Address bean into the page scope? Joshua This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: bean:define and el tags
You're missing an important point about the JSTL tags. The tags that store information into variables don't put them into scriptlet variables, they put them into scoped variables, which are just HashMap entries. If you use fmt:formatDate to store a formatted date into currentdate, you can't reference it with %=currentdate%. If you're using the JSTL with Struts, you're probably better off using Struts-EL, as the Struts-EL tags use the JSTL EL for attribute values, instead of scriptlet expressions. -Original Message- From: Mohan Radhakrishnan [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 12:37 AM To: 'Struts Users Mailing List' Subject: bean:define and el tags Hi I am trying to use simple if-else logic here. Date formatter - jsp:useBean id=now class=java.util.Date / fmt:formatDate var=currentdate value=${now} pattern=dd/MM// If my indexed property in the form returns null, I use the current date. c:choose c:when test=${form.startDate[0] != null} bean:define id=date name=form property='%= startDate[ + 0 + ] %'/ /c:when c:when test=${form.startDate[0] == null} bean:define id=date value=%=currentdate%/ /c:when /c:choose This is to populate my html:text box like this html:text value=%=date.toString()% Is something wrong here ? It seems that the variable date is not found at runtime. Thanks, Mohan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts bean:define tag questions
What do you want to do whith your city ? You can do : bean: name=UserVO property=adress.city Nico. Ok, Imagine I have an object User (package test.UserVO) which contains another object Address (package test.AddressVO)which has a String property city. User and Address are both java beans. User has been placed in session scope as UserVO. How would I access the property city? I noticed that the bean:define tag has a copy feature which will copy a bean to a different scope. Could this feature be used here? Could you copy the nested Address bean into the page scope? Joshua This communication, including attachments, is for the exclusive use of addressee and may contain proprietary, confidential or privileged information. If you are not the intended recipient, any use, copying, disclosure, dissemination or distribution is strictly prohibited. If you are not the intended recipient, please notify the sender immediately by return email and delete this communication and destroy all copies. - 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]
Bean:define and nulls
Hi, I want to use a bean:define tag within a logic:iterate tag to set a bean value to null. How can I do this if I can not use the same value for the id attibute. thanks Jordan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bean:define and nulls
I don't believe bean:define can help you with that. You'll probably have to do this with a scriptlet, a custom tag.or better yet, you should take care of that in your action class. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: Jordan Thomas [mailto:[EMAIL PROTECTED]] Sent: Monday, February 17, 2003 7:39 AM To: Struts User List Subject: Bean:define and nulls Hi, I want to use a bean:define tag within a logic:iterate tag to set a bean value to null. How can I do this if I can not use the same value for the id attibute. thanks Jordan - 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: using bean:define
In your action class, are you actually populating a List in your form before forwarding to that page? From the error, it appears that getTableNames() on your form is returning null. -- James Mitchell - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 5:30 PM Subject: using bean:define Hi, I am new to struts. I am trying to use the html:options collection=tableNames I get the error javax.servlet.jsp.JspException: Define tag cannot set a null value at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:272) at jsp_servlet.__mffs._jspService(__mffs.java:237) What am I doing wrong when I am trying to create the bean bean:define id=tableNames name=mffsActionForm property=tableNames type=java.util.List / Regards Rajesh J Here is the JSP code %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html% %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean% html:html head titleMFFS/title /head body topmargin=0 leftmargin=0 table border=0 width=100% height=100% cellspacing=0 cellpadding=0 tr td width=100% height=72 bgcolor=#66 style=color: #FF nbsp;strongfont size=8 face=ATSackLightRomNoBallshtml:img width=61 height=45 src=images/top.bmp border=0/MFFS/font/strong/td /tr tr td width=100% height=20 bgcolor=#EAnbsp;/td /tr tr td width=100% height=95% valign=middle align=center html:form action=mffsAction name=mffsActionForm type=lam.mffs.form.MffsActionForm scope=session pnbsp;nbsp;nbsp;nbsp; nbsp;nbsp; /p table border=1 height=33 bordercolor=#00 bordercolorlight= #00 bordercolordark=#00 tr td width=100 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2End Date/font/td td width=100 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5 html:text property =end_date size=10//td td width=150 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 Choose Table/font/td td width=200 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5 font size=2 bean:define id=tableNames name=mffsActionForm property=tableNames type=java.util.List / html:select property=tables style=font-size: 10pt size=1 html:options collection=tableNames labelProperty =labelProperty property=property/ /html:select/font/td td width=200 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 Product Description/font/td td width=300 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 /font/td td width=130 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5applet code =fphover.class codebase=./ width=120 height=24 param name=color value=#80 param name=hovercolor value=#FF param name=textcolor value=#FF param name=text value=Get Data param name=effect value=glow /applet /td /tr /table p nbsp; /p /html:form /td /tr /table /body /html:html here is my formbean public class MffsActionForm extends ActionForm { private String tables; private List tableNames; private Date end_date; private List product_desc; public void setTables(String Tables) { this.tables = Tables; } public String getTables() { return tables; } public void setEnd_date(Date end_date) { this.end_date = end_date; } public Date getEnd_date() { return end_date; } public void setProduct_desc(List product_desc) { this.product_desc = product_desc; } public List getProduct_desc() { return product_desc; } public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { /**@todo: finish this method, this is just the skeleton.*/ return null; } public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { tables = null; end_date = null; product_desc = null; } public List getTableNames() { return tableNames; } public void setTableNames(List tableNames
Re: using bean:define
I definetely am populating the form variable.. here is the action class public class InitMffsAction extends Action { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { PropertyResourceBundle prb = null; try { System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + actionMapping.toString()); System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + httpServletRequest.toString()); lam.mffs.form.MffsActionForm mfform = (lam.mffs.form.MffsActionForm) actionForm; InputStream is = this.getClass().getClassLoader().getResourceAsStream( lam/mffs/action/mffsdata.properties); prb = new PropertyResourceBundle(is); Context ctx = this.getInitialContext(prb.getString( servlet.initialcontext.url)); MffsSessionHome home = (MffsSessionHome)ctx.lookup(MffsSession); MffsSessionRemote admin = (MffsSessionRemote)home.create(); mfform.setEnd_date(admin.getEndDate()); mfform.setProduct_desc(admin.getProdctDescription()); mfform.setTableNames(admin.getTableNames()); } catch (Exception e) { LamLog.log(this, LamLog.FATAL, Problem getting initial data from ejb + e.getMessage()); throw new java.lang.UnsupportedOperationException( Method perform() has thrown an exception + e.getMessage()); } return actionMapping.findForward(success); } private Context getInitialContext(String url) throws Exception { Properties properties = null; try { properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, weblogic.jndi.WLInitialContextFactory); properties.put(Context.PROVIDER_URL, url); } catch (Exception e) { LamLog.log(this, LamLog.FATAL, Unable to connect to WebLogic server at + url); throw e; } return new InitialContext(properties); } } To: Struts Users Mailing List [EMAIL PROTECTED] James Mitchellcc: [EMAIL PROTECTED]Subject: Re: using bean:define g 14 Feb 2003 09:36 AM Please respond to Struts Users Mailing List In your action class, are you actually populating a List in your form before forwarding to that page? From the error, it appears that getTableNames() on your form is returning null. -- James Mitchell - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 13, 2003 5:30 PM Subject: using bean:define Hi, I am new to struts. I am trying to use the html:options collection=tableNames I get the error javax.servlet.jsp.JspException: Define tag cannot set a null value at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:272) at jsp_servlet.__mffs._jspService(__mffs.java:237) What am I doing wrong when I am trying to create the bean bean:define id=tableNames name=mffsActionForm property=tableNames type=java.util.List / Regards Rajesh J Here is the JSP code %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html% %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean% html:html head titleMFFS/title /head body topmargin=0 leftmargin=0 table border=0 width=100% height=100% cellspacing=0 cellpadding=0 tr
RE: using bean:define
(Sorry if this double posts, getting System Admin messages, not sure if its my SMTP server or some loser on the list sending me that crap) Most likely, your getTables() is returning null. You can check the source for DefineTag if you like. I just finished an exhaustive test suite for that tag, so I know it works 100%. I would add some debug in your action to verify that its not null. That's probably your quickest move to finding the culprit. ... ... mfform.setEnd_date(admin.getEndDate()); mfform.setProduct_desc(admin.getProdctDescription()); mfform.setTableNames(admin.getTableNames()); if (mfform.getTables() == null){ LamLog.log(this, LamLog.FATAL, Problem getting TableNames from ejb + e.getMessage()); } } catch (Exception e) { ... ... Hope that helps. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 9:57 AM To: Struts Users Mailing List Subject: Re: using bean:define I definetely am populating the form variable.. here is the action class public class InitMffsAction extends Action { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { PropertyResourceBundle prb = null; try { System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + actionMapping.toString()); System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + httpServletRequest.toString()); lam.mffs.form.MffsActionForm mfform = (lam.mffs.form.MffsActionForm) actionForm; InputStream is = this.getClass().getClassLoader().getResourceAsStream( lam/mffs/action/mffsdata.properties); prb = new PropertyResourceBundle(is); Context ctx = this.getInitialContext(prb.getString( servlet.initialcontext.url)); MffsSessionHome home = (MffsSessionHome)ctx.lookup(MffsSession); MffsSessionRemote admin = (MffsSessionRemote)home.create(); mfform.setEnd_date(admin.getEndDate()); mfform.setProduct_desc(admin.getProdctDescription()); mfform.setTableNames(admin.getTableNames()); } catch (Exception e) { LamLog.log(this, LamLog.FATAL, Problem getting initial data from ejb + e.getMessage()); throw new java.lang.UnsupportedOperationException( Method perform() has thrown an exception + e.getMessage()); } return actionMapping.findForward(success); } private Context getInitialContext(String url) throws Exception { Properties properties = null; try { properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, weblogic.jndi.WLInitialContextFactory); properties.put(Context.PROVIDER_URL, url); } catch (Exception e) { LamLog.log(this, LamLog.FATAL, Unable to connect to WebLogic server at + url); throw e; } return new InitialContext(properties); } } To: Struts Users Mailing List [EMAIL PROTECTED] James Mitchellcc: [EMAIL PROTECTED]Subject: Re: using bean:define g 14 Feb 2003 09:36 AM Please respond to Struts Users Mailing List
RE: using bean:define
THanx, My mistake I was getting the bean from a different server. Everything works fine. Regards Rajesh J To: 'Struts Users Mailing List' [EMAIL PROTECTED] James Mitchell cc: [EMAIL PROTECTED]Subject: RE: using bean:define et Sent by: James Mitchell [EMAIL PROTECTED] 14 Feb 2003 10:27 AM Please respond to Struts Users Mailing List (Sorry if this double posts, getting System Admin messages, not sure if its my SMTP server or some loser on the list sending me that crap) Most likely, your getTables() is returning null. You can check the source for DefineTag if you like. I just finished an exhaustive test suite for that tag, so I know it works 100%. I would add some debug in your action to verify that its not null. That's probably your quickest move to finding the culprit. ... ... mfform.setEnd_date(admin.getEndDate()); mfform.setProduct_desc(admin.getProdctDescription()); mfform.setTableNames(admin.getTableNames()); if (mfform.getTables() == null){ LamLog.log(this, LamLog.FATAL, Problem getting TableNames from ejb + e.getMessage()); } } catch (Exception e) { ... ... Hope that helps. -- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ The man who does not read good books has no advantage over the man who cannot read them. - Mark Twain (1835-1910) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 9:57 AM To: Struts Users Mailing List Subject: Re: using bean:define I definetely am populating the form variable.. here is the action class public class InitMffsAction extends Action { public ActionForward perform(ActionMapping actionMapping, ActionForm actionForm, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { PropertyResourceBundle prb = null; try { System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + actionMapping.toString()); System.out.println( ---Printing from within perform of LegaldocsqueryinitAction : + httpServletRequest.toString()); lam.mffs.form.MffsActionForm mfform = (lam.mffs.form.MffsActionForm) actionForm; InputStream is = this.getClass().getClassLoader().getResourceAsStream( lam/mffs/action/mffsdata.properties); prb = new PropertyResourceBundle(is); Context ctx = this.getInitialContext(prb.getString( servlet.initialcontext.url)); MffsSessionHome home = (MffsSessionHome)ctx.lookup(MffsSession); MffsSessionRemote admin = (MffsSessionRemote)home.create(); mfform.setEnd_date(admin.getEndDate()); mfform.setProduct_desc(admin.getProdctDescription()); mfform.setTableNames(admin.getTableNames()); } catch (Exception e) { LamLog.log(this, LamLog.FATAL, Problem getting initial data from ejb + e.getMessage()); throw new
using bean:define
Hi, I am new to struts. I am trying to use the html:options collection=tableNames I get the error javax.servlet.jsp.JspException: Define tag cannot set a null value at org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:272) at jsp_servlet.__mffs._jspService(__mffs.java:237) What am I doing wrong when I am trying to create the bean bean:define id=tableNames name=mffsActionForm property=tableNames type=java.util.List / Regards Rajesh J Here is the JSP code %@ page contentType=text/html;charset=UTF-8 language=java % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html% %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic% %@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean% html:html head titleMFFS/title /head body topmargin=0 leftmargin=0 table border=0 width=100% height=100% cellspacing=0 cellpadding=0 tr td width=100% height=72 bgcolor=#66 style=color: #FF nbsp;strongfont size=8 face=ATSackLightRomNoBallshtml:img width=61 height=45 src=images/top.bmp border=0/MFFS/font/strong/td /tr tr td width=100% height=20 bgcolor=#EAnbsp;/td /tr tr td width=100% height=95% valign=middle align=center html:form action=mffsAction name=mffsActionForm type=lam.mffs.form.MffsActionForm scope=session pnbsp;nbsp;nbsp;nbsp; nbsp;nbsp; /p table border=1 height=33 bordercolor=#00 bordercolorlight= #00 bordercolordark=#00 tr td width=100 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2End Date/font/td td width=100 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5 html:text property =end_date size=10//td td width=150 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 Choose Table/font/td td width=200 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5 font size=2 bean:define id=tableNames name=mffsActionForm property=tableNames type=java.util.List / html:select property=tables style=font-size: 10pt size=1 html:options collection=tableNames labelProperty =labelProperty property=property/ /html:select/font/td td width=200 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 Product Description/font/td td width=300 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5font size=2 /font/td td width=130 height=27 bordercolor=#FF bordercolorlight= #FF bordercolordark=#FF bgcolor=#e0ebf5applet code =fphover.class codebase=./ width=120 height=24 param name=color value=#80 param name=hovercolor value=#FF param name=textcolor value=#FF param name=text value=Get Data param name=effect value=glow /applet /td /tr /table p nbsp; /p /html:form /td /tr /table /body /html:html here is my formbean public class MffsActionForm extends ActionForm { private String tables; private List tableNames; private Date end_date; private List product_desc; public void setTables(String Tables) { this.tables = Tables; } public String getTables() { return tables; } public void setEnd_date(Date end_date) { this.end_date = end_date; } public Date getEnd_date() { return end_date; } public void setProduct_desc(List product_desc) { this.product_desc = product_desc; } public List getProduct_desc() { return product_desc; } public ActionErrors validate(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { /**@todo: finish this method, this is just the skeleton.*/ return null; } public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) { tables = null; end_date = null; product_desc = null; } public List getTableNames() { return tableNames; } public void setTableNames(List tableNames) { this.tableNames = tableNames; } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:define concatenation
HI, I have used the following: bean:define id=medKey name=searchResult property=lastName / I want to be able to concatenate 2 of these properties from the bean into the medKey. i.e. combine last name and firstname into medKey' with a bean:define and then use the variable. bean:define id=medKey name=searchResult property=lastName / bean:define id=medKey name=searchResult property=firstName / TIA, Vijay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: bean:define concatenation
Have you tried? bean:define id=medKey bean:write name=searchResult property=lastName/ bean:write name=searchResult property=lastName/ /bean:define -- James Mitchell - Original Message - From: Balakrishnan, Vijay [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, February 11, 2003 4:07 PM Subject: bean:define concatenation HI, I have used the following: bean:define id=medKey name=searchResult property=lastName / I want to be able to concatenate 2 of these properties from the bean into the medKey. i.e. combine last name and firstname into medKey' with a bean:define and then use the variable. bean:define id=medKey name=searchResult property=lastName / bean:define id=medKey name=searchResult property=firstName / TIA, Vijay - 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: bean:define concatenation
That worked like a charm. Thanks. -Original Message- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 11, 2003 1:12 PM To: Struts Users Mailing List Subject: Re: bean:define concatenation Have you tried? bean:define id=medKey bean:write name=searchResult property=lastName/ bean:write name=searchResult property=lastName/ /bean:define -- James Mitchell - Original Message - From: Balakrishnan, Vijay [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, February 11, 2003 4:07 PM Subject: bean:define concatenation HI, I have used the following: bean:define id=medKey name=searchResult property=lastName / I want to be able to concatenate 2 of these properties from the bean into the medKey. i.e. combine last name and firstname into medKey' with a bean:define and then use the variable. bean:define id=medKey name=searchResult property=lastName / bean:define id=medKey name=searchResult property=firstName / TIA, Vijay - 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]
bean:define, logic:equal problem with rt expr values
Hi, I'm using Struts 1.1b and want to use logic:equal to compare values and I'm totally stuck when I try to use no constant for the value attribute... My code this: I have a formbean named ListExperimentForm with a getter method getTopics() to return a collection of Objects each containing a private int member variable topicid I would like to check inside the iteration if the topicid matched a runtime expression. That could be a get parameter or any scripting variable. But I don't get it work. logic:equal name=topicsList property=topicid value=5 is fine... but I can't use a constant value attribute, of course. If I for example try: % int myint = 5; % logic:iterate id=topicsList name=ListExperimentsForm property=topics logic:equal name=topicsList property=topicid value=% =myint % DOSOMETHINGCONDITIONAL /logic:equal DOSOMETHING /logic nothing happens if topicid == 5... I guess this is because of: /* logic:equal */ org.apache.struts.taglib.logic.EqualTag _jspx_th_logic_equal_3 = (org.apache.struts.taglib.logic.EqualTag) _jspx_tagPool_logic_equal_value_property_name.get(org.apache.struts.tagl ib.logic.EqualTag.class); _jspx_th_logic_equal_3.setPageContext(pageContext); _jspx_th_logic_equal_3.setParent(_jspx_th_logic_iterate_0); _jspx_th_logic_equal_3.setName(topicsList); _jspx_th_logic_equal_3.setProperty(topicid); _jspx_th_logic_equal_3.setValue(% =myint %); So topicid is not compared to the value of myint, instead it's compared to the string % =myint %... I'm confused. Especially after reading examples like: http://j2ee.masslight.com/Chapter5.html I can't see the difference... How can I solve this issue with runtime expressions? I've tried it with other struts tags, too Whenever I need to put a scriptlet variable into e.g. a value attribute of a tag, nothing works as expected. Thanks for any hint... I'm getting gray hair and think about using scriptlets instead of struts tags, if I don't find out what's wrong soon... Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: bean:define, logic:equal problem with rt expr values
You typed % =myint % instead of %= myint % ! I used this a lot of time : logic:equal name=topicsList property=topicid value=%= MyClass.CONSTANT_VALUE % foo /logic:equal Nico. Hi, I'm using Struts 1.1b and want to use logic:equal to compare values and I'm totally stuck when I try to use no constant for the value attribute... My code this: I have a formbean named ListExperimentForm with a getter method getTopics() to return a collection of Objects each containing a private int member variable topicid I would like to check inside the iteration if the topicid matched a runtime expression. That could be a get parameter or any scripting variable. But I don't get it work. logic:equal name=topicsList property=topicid value=5 is fine... but I can't use a constant value attribute, of course. If I for example try: % int myint = 5; % logic:iterate id=topicsList name=ListExperimentsForm property=topics logic:equal name=topicsList property=topicid value=% =myint % DOSOMETHINGCONDITIONAL /logic:equal DOSOMETHING /logic nothing happens if topicid == 5... I guess this is because of: /* logic:equal */ org.apache.struts.taglib.logic.EqualTag _jspx_th_logic_equal_3 = (org.apache.struts.taglib.logic.EqualTag) _jspx_tagPool_logic_equal_value_property_name.get(org.apache.struts.tagl ib.logic.EqualTag.class); _jspx_th_logic_equal_3.setPageContext(pageContext); _jspx_th_logic_equal_3.setParent(_jspx_th_logic_iterate_0); _jspx_th_logic_equal_3.setName(topicsList); _jspx_th_logic_equal_3.setProperty(topicid); _jspx_th_logic_equal_3.setValue(% =myint %); So topicid is not compared to the value of myint, instead it's compared to the string % =myint %... I'm confused. Especially after reading examples like: http://j2ee.masslight.com/Chapter5.html I can't see the difference... How can I solve this issue with runtime expressions? I've tried it with other struts tags, too Whenever I need to put a scriptlet variable into e.g. a value attribute of a tag, nothing works as expected. Thanks for any hint... I'm getting gray hair and think about using scriptlets instead of struts tags, if I don't find out what's wrong soon... Michael -- 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: bean:define, logic:equal problem with rt expr values
Thanks for saving my last hairs... that put me on track. But actually I got a compiler error this time: cannot resolve symbol symbol : method setValue (int) location: class org.apache.struts.taglib.logic.EqualTag _jspx_th_logic_equal_3.setValue( myint ); ^ 1 error Obviously there is no setValue() method for this bean:equal tag which could take integers. After I changed to String: % String mystr = 5 % logic:equal name=topicsList property=topicid value=%= mystr% /logic:equal it finally worked... Guess you just used string constants?! Anyway if I type convert like %= Integer.toString(myint) % beforehand, it's fine, too... Thx again. Michael P.S. stupid space mistake and type conversion costing 2 hours or more... -Original Message- From: Nicolas De Loof [mailto:[EMAIL PROTECTED]] Sent: Freitag, 24. Januar 2003 14:23 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: bean:define, logic:equal problem with rt expr values You typed % =myint % instead of %= myint % ! I used this a lot of time : logic:equal name=topicsList property=topicid value=%= MyClass.CONSTANT_VALUE % foo /logic:equal Nico. Hi, I'm using Struts 1.1b and want to use logic:equal to compare values and I'm totally stuck when I try to use no constant for the value attribute... My code this: I have a formbean named ListExperimentForm with a getter method getTopics() to return a collection of Objects each containing a private int member variable topicid I would like to check inside the iteration if the topicid matched a runtime expression. That could be a get parameter or any scripting variable. But I don't get it work. logic:equal name=topicsList property=topicid value=5 is fine... but I can't use a constant value attribute, of course. If I for example try: % int myint = 5; % logic:iterate id=topicsList name=ListExperimentsForm property=topics logic:equal name=topicsList property=topicid value=% =myint % DOSOMETHINGCONDITIONAL /logic:equal DOSOMETHING /logic nothing happens if topicid == 5... I guess this is because of: /* logic:equal */ org.apache.struts.taglib.logic.EqualTag _jspx_th_logic_equal_3 = (org.apache.struts.taglib.logic.EqualTag) _jspx_tagPool_logic_equal_value_property_name.get(org.apache.struts.ta gl ib.logic.EqualTag.class); _jspx_th_logic_equal_3.setPageContext(pageContext); _jspx_th_logic_equal_3.setParent(_jspx_th_logic_iterate_0); _jspx_th_logic_equal_3.setName(topicsList); _jspx_th_logic_equal_3.setProperty(topicid); _jspx_th_logic_equal_3.setValue(% =myint %); So topicid is not compared to the value of myint, instead it's compared to the string % =myint %... I'm confused. Especially after reading examples like: http://j2ee.masslight.com/Chapter5.html I can't see the difference... How can I solve this issue with runtime expressions? I've tried it with other struts tags, too Whenever I need to put a scriptlet variable into e.g. a value attribute of a tag, nothing works as expected. Thanks for any hint... I'm getting gray hair and think about using scriptlets instead of struts tags, if I don't find out what's wrong soon... Michael -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [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]
problem with bean:define tag
Hi, I am having a strange problem with stuts 1.1.b3 (with Weblogic 7). Everything woks fine with struts 1.1.b1 but when I moved to the 1.1.b3 the define tag is generating an exception. The define tag that generates the execption: bean:define name=%=beanName% id=path property=path scope=request toScope=page / The generated exception : javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content Adel. - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
RE: problem with bean:define tag
Note that you will get this message if the count of name, value, and body is != 1. The message sounds like it's saying you have more than one of them, but in truth you could get the error if you had none of them. I'm going to guess that beanName is empty or null. -Original Message- From: Adel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 10:31 AM To: [EMAIL PROTECTED] Subject: problem with bean:define tag Hi, I am having a strange problem with stuts 1.1.b3 (with Weblogic 7). Everything woks fine with struts 1.1.b1 but when I moved to the 1.1.b3 the define tag is generating an exception. The define tag that generates the execption: bean:define name=%=beanName% id=path property=path scope=request toScope=page / The generated exception : javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content Adel. - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: problem with bean:define tag
Hi again, Thanks for your answer David. The beanName I am using is Action.Mapping_KEY: bean:define name=%=Action.Mapping_KEY% id=path property=path scope=request toScope=page / This works fine with 1.1b1 but not with 1.1b3. Adel Note that you will get this message if the count of name, value, and body is != 1. The message sounds like it's saying you have more than one of them, but in truth you could get the error if you had none of them. I'm going to guess that beanName is empty or null. -Original Message- From: Adel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 10:31 AM To: [EMAIL PROTECTED] Subject: problem with bean:define tag Hi, I am having a strange problem with stuts 1.1.b3 (with Weblogic 7). Everything woks fine with struts 1.1.b1 but when I moved to the 1.1.b3 the define tag is generating an exception. The define tag that generates the execption: bean:define name=%=beanName% id=path property=path scope=request toScope=page / The generated exception : javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content Adel. - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now - Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now
RE: problem with bean:define tag
That seems like a weird name to use, but it might work. You really should just be executing this in the debugger so you can see exactly what is happening. -Original Message- From: Adel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 1:05 PM To: [EMAIL PROTECTED] Subject: Re: problem with bean:define tag Hi again, Thanks for your answer David. The beanName I am using is Action.Mapping_KEY: bean:define name=%=Action.Mapping_KEY% id=path property=path scope=request toScope=page / This works fine with 1.1b1 but not with 1.1b3. Adel Note that you will get this message if the count of name, value, and body is != 1. The message sounds like it's saying you have more than one of them, but in truth you could get the error if you had none of them. I'm going to guess that beanName is empty or null. -Original Message- From: Adel [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 10:31 AM To: [EMAIL PROTECTED] Subject: problem with bean:define tag Hi, I am having a strange problem with stuts 1.1.b3 (with Weblogic 7). Everything woks fine with struts 1.1.b1 but when I moved to the 1.1.b3 the define tag is generating an exception. The define tag that generates the execption: bean:define name=%=beanName% id=path property=path scope=request toScope=page / The generated exception : javax.servlet.jsp.JspException: Define tag can contain only one of name attribute, value attribute, or body content -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
problem with bean:define
Title: Message Hi, I have a small problem, which I need to address urgently. I have a Vector and am using logic:iterate to iterate through each element. I want to define each element as a bean inside the iterate tag. Is this possible? I am trying the following, but it gives an error: logic:iterate name="servicesForm" property="serviceObject" id="serviceObjectId" From the form bean, I am accessing serviceObject, which is a java.util.Vector. bean:define name="serviceObjectId" property="distributionSystems" id="distributionSystems"/ Defining the current element of the iteration as a bean using the "id" defined in logic:iterate html:select property="distributionSystem" styleClass="FieldText" html:options collection="distributionSystems" property="code" labelProperty="name"/ Retrieving the code and name attributes of the bean /html:select/logic:iterate Do I anywhere need to mention the type of objects contained in the Vector? Thanks, Suresh **Disclaimer Information contained in this E-MAIL being proprietary to Wipro Limited is 'privileged' and 'confidential' and intended for use only by the individual or entity to which it is addressed. You are notified that any use, copying or dissemination of the information contained in the E-MAIL in any manner whatsoever is strictly prohibited. *** -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]