RE: simple question
Try this. String hulp=request.getParameter(users.userId); request.setAttribute(hulp,hulp); return mapping.findForward(CONTINUE); and in jsp %=hulp% it will work Thanks Nazeer -Original Message- From: dirk [mailto:[EMAIL PROTECTED] Sent: Monday, December 22, 2003 10:42 AM To: Struts Users Mailing List Subject: simple question I have an action which contains the following: String hulp=request.getParameter(users.userId); return mapping.findForward(CONTINUE); continue points to user.jsp. How can i use in the file user.jsp the value of hulp ? eg: %=hulp% is not working. Thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Is there a way to set variable using Struts?
I have not seen the if-else in Struts Tag. logic:equal property=tableCounter value=1 tableCounter = 2; /logic:equal logic:notEqual property=tableCounter value=1 tableCounter = 1; /logic:notEqual Thanks Nazeer -Original Message- From: Clark Kent [mailto:[EMAIL PROTECTED] Sent: Thursday, December 18, 2003 1:17 PM To: usergroup Subject: Is there a way to set variable using Struts? I have the following scriptlet code : if(tableCounter == 1){ tableCounter = 2; } else { tableCounter = 1; } How do I achieve the above code using Struts tags (without using JSTL)? Thanks, CK - Do you Yahoo!? New Yahoo! Photos - easier uploading and sharing - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: dynamic selection of messages from properties file
Try this bean:define name=column property=investmentPeriodType id=investmentPeriodType type=java.lang.String / bean:message name=column bundle=konditionsuebersicht.select.%=investmentPeriodType % / if this doesn't work try this bean:define name=column property=investmentPeriodType id=investmentPeriodType type=java.lang.String / % String colName = konditionsuebersicht.select. + String.valueOf(investmentPeriodType); request.setAttribute(colName,colName); % bean:message name=column bundle=colName / Thanks Nazeer -Original Message- From: Zmitko, Jan [mailto:[EMAIL PROTECTED] Sent: Thursday, November 20, 2003 4:05 PM To: '[EMAIL PROTECTED]' Subject: dynamic selection of messages from properties file Hello, I try to show messages in the GUI depending on values from backend. The value which I receive are of the type int like 1, 2, 3 Now I have to show the correctly message. The messages in my .properties File show as follows. Because of a better of readability I would´t write in the .properties File not only the number. konditionsuebersicht.select.2 = Tag konditionsuebersicht.select.3 = Woche konditionsuebersicht.select.4 = Monate konditionsuebersicht.select.5 = Jahre Now I try to use these message with the bean:message tag. I try different ways but no was successful. The last shot shows as follows: bean:define name=column property=investmentPeriodType id=investmentPeriodType/ bean:message name=column bundle=konditionsuebersicht.select.{$investmentPeriodType} / I get the error: javax.servlet.jsp.JspException: Property for message key must be a String Can anobody help me with my problem. Thanks Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Good UI editor to use with Struts?
I like WASD 5.1 Thanks Nazeer -Original Message- From: Davidson, Glenn [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 19, 2003 4:00 PM To: 'Struts Users Mailing List' Subject: OT: Good UI editor to use with Struts? Which UI editor would you recommend someone use when developing web applications based upon the struts framework? I am using eclipse as my IDE. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: ActionErrors configuration
Try this action path=/profile/systemDetails type=com.paycycle.profile.actions.SystemDetailsAction name=systemDetailForm scope=request input=/systemDetails Thanks Nazeer -Original Message- From: Ramesh Bobba [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 4:10 PM To: [EMAIL PROTECTED] Subject: ActionErrors configuration Hi, I am trying to configure my app so that when some of the text fields are not populated, I show errors and redisplay the same page. The configuration I have is: action path=/systemDetails type=com.paycycle.profile.actions.SystemDetailsAction name=systemDetailForm scope=request input=/systemDetails . /action When I try to run the app with this configuration and there are errors, I get: The requested resource (/profile/systemDetails) is not available. Can you help me out here? Thanks, Ramesh. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: javascript question...
Try this script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=+namVal); } /script Thanks Nazeer -Original Message- From: Jacob Wilson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 29, 2003 4:37 PM To: [EMAIL PROTECTED] Subject: javascript question... Hi... Is it possible to send a value of a form element from the parent window to the child window like this??? script function go() { var namVal = document.fm1.txtName.value; var newwin=window.open(a.html?Name=namVal); } /script form name=fm1 onSubmit=go() input type=text name=txtName input type=submit value=go /form The above does not work... it will give me 'namVal' as the value rather than the actual typed in value when I try to get request.getParameter How can I achieve this functionality??? I need to pass a form element value when opening a new window. This value is essential at this point coz I perform an action based on this value and then bring the pop up page Suggestions requested please... Thanks! Jacob - Do you Yahoo!? Exclusive Video Premiere - Britney Spears - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can an action foward be an action?
YES Thanks Nazeer -Original Message- From: Barry Volpe [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 28, 2003 5:14 PM To: Struts Users Mailing List Subject: Can an action foward be an action? Like the following? action path=/ViewCity type=com.childrencare.CityAction name=cityForm scope=request input=/citypage.jsp validate=false set-property property=loginRequired value=false/ forward name=myView path=/View.do/ forward name=error path=/citypage.jsp/ forward name=cancel path=/index.jsp/ /action Fowarded to: action path=/View - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: quick html:link question
Hi, When you define a bean using bean:define the scope of bean is not request. Add this may be this will work % String choice = hello; % bean:define id=nameOfButton value=%=choice% / request.setAttribute(nameOfButton,choice) Thanks Nazeer -Original Message- From: Sonam Belbase [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 22, 2003 2:43 PM To: Struts Users Mailing List Subject: quick html:link question Hi, If I've got % String choice = hello; % bean:define id=nameOfButton value=%=choice% / html:link action=dcIndicator target=templateFrame paramId=choice paramName=nameOfButton Click here /html:link why does request_.getAttribute(choice); in my action retrieve null? Is this the right way to retrieve values of params you pass with html:link to an action? Thanks, SB -- 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: Urgent: issue with logic:present role=user, gold, platinum
Remove the space after , this may work. logic:present role=user,gold,platinum Thanks Nazeer -Original Message- From: Mick Knutson [mailto:[EMAIL PROTECTED] Sent: Monday, October 13, 2003 12:20 PM To: struts Subject: Urgent: issue with logic:present role=user, gold, platinum I am sorry to say urgent, but I have to demo this to my boss this afternoon and I am stumped. I have 3 different types of users. user, gold and platinum. I need to only show this edit button to those users with this tag as noted by Craig. But the button only shows up if I am logged in as a user, not gold, and not platinum.: logic:present role=user, gold, platinum html:submit property=action styleClass=form_button bean:message key=button.edit/ /html:submit /logic:present Here is my web.xml setting. servlet servlet-nameaction/servlet-name servlet-classcom.baselogic.yoursos.struts.ExtendedActionServlet/servl et-class init-param param-nameconfig/param-name param-value/WEB-INF/struts-config.xml/param-value /init-param init-param param-namedebug/param-name param-value3/param-value /init-param init-param param-namedetail/param-name param-value1/param-value /init-param load-on-startup1/load-on-startup security-role-ref role-nameuser/role-name role-linkuser/role-link /security-role-ref security-role-ref role-namegold/role-name role-linkgold/role-link /security-role-ref security-role-ref role-nameplatinum/role-name role-linkplatinum/role-link /security-role-ref /servlet --- Thanks Mick Knutson The world is a playground...Play Hard, Play Smart. Visit http://www.YourSoS.com to learn how our Personal Emergency Alert Contact System can help you Play Smart. +00 1 (708) 570-2772 Fax MSN: mickknutson ICQ: 316498480 ICQ URL: http://wwp.icq.com/316498480 --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LabelValueBean - 3 fields?
Yes, For that you need to extend the LabelValueBean and add one more variable know as description and write setter and getter method. Thanks Nazeer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 24, 2003 4:13 PM To: Struts Users Mailing List Subject: LabelValueBean - 3 fields? Hi, is it possible to store 3 fields in LabelValueBean instead of 2? i.e. value, label description? thanx! = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = This transmittal and any attachments may contain confidential, privileged or sensitive information and is solely for the use of the intended recipient. If you are not intended recipient, you are hereby notified that you have received this transmittal and any such attachments in error and any review, dissemination, distribution or copying thereof is strictly prohibited. If you have received this transmittal and any attachments in error please notify the sender and immediately destroy the message and all its attachments. Any opinions herein expressed may be those of the author and not necessarily of Mizuho Corporate Bank, Ltd (the Bank). The Bank accepts no responsibility for the accuracy or completeness of any information herein contained. = = = = = = = = = == = = = = = == = = = = = = = == = = = = = == = = = = - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem with logic:equal?
You have defined the user bean between the logic:equal tag this will visible if it is out of scope. Like If(something==true) { User userName = someUser; } if(something!=true){ userName } if you try to use user it is out of scope 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 Thanks Nazeer -Original Message- From: Bjørn T Johansen [mailto:[EMAIL PROTECTED] Sent: Sunday, September 14, 2003 7:46 AM To: Struts Users Mailing List Subject: Problem with logic:equal? 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: actionmapping set-property problem in 1.1 upgrade
Extend the com.participate.util.client.struts.ApplicationActionMapping to have a getter and setter method for continue and change the className in the Struts config. Then you can use set property Thanks Nazeer -Original Message- From: Bill Milbratz [mailto:[EMAIL PROTECTED] Sent: Thursday, September 11, 2003 11:06 AM To: '[EMAIL PROTECTED]' Subject: actionmapping set-property problem in 1.1 upgrade Hi, We're upgrading to struts 1.1 and came across a problem with 'action specific' 'set-property' elements. I've searched the archives but haven't come across this problem. Specifically this action entry: !-- Display Public Profile -- action path=/profile/publicprofile type=com.participate.pe.profile.client.actions.PublicProfileInit name=publicProfileForm scope=request className=com.participate.util.client.struts.ApplicationActionMapping set-property property=public value=true/ forward name=continue path=/profile/include/publicprofile.jsp / /action yields this error: [2003-09-11 09:24:45,031] [ERROR] org.apache.commons.digester.Digester (Digester.java:1275) - Begin event threw exception java.lang.NoSuchMethodException: Bean has no property named public at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:1 92) at org.apache.commons.digester.Rule.begin(Rule.java:200) The 1.1 dtd appears to still support the 'set-property' element in the 'action' element : ELEMENT action (icon?, display-name?, description?, set-property*, exception*, forward*) The code looks like it only supports 'module-wide' mappings (from initModuleConfig(String prefix, String paths) ): // Support for module-wide ActionMapping type override String mapping = getServletConfig().getInitParameter(mapping); if (mapping != null) { config.setActionMappingClass(mapping); } Two questions: 1) Any workarounds for this? 2) We use this set-property to indicate which servlets are 'public facing' and which require login. If anyone has a better solution for distinguishing between such actions, I'd appreciate any insights. thanks, bill
RE: J2EE IDE
WSAD is the Good one. Thanks Nazeer -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 27, 2003 2:46 AM To: [EMAIL PROTECTED] Subject: J2EE IDE Can someone please suggest me a free J2EE IDE suitable for development of webapps using STRUTS. I know of some IDE's like the FORTE, ECLIPSE, NETBEANS. However I wanted to ckeckout if anyone has already evaluated any of these since I am not sure which one is easy to use and has reasonably good features as well. Regards Sreekant G - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Java Question
Since you have already Defined the conn and stmt you no need to defined again . public class OrgIdService implements Serializable { //Declare and initialize variables Connection conn = null; Statement stmt = null; ResultSet rs = null; ArrayList facilList = new ArrayList(); Just remove Statement and ResultSet from line 56 and 57 Compile again it will work fine. Eg : stmt = conn.createStatement(); rs = stmt.executeQuery(SELECT Thanks Nazeer -Original Message- From: Kapadia Mitesh-C23457 [mailto:[EMAIL PROTECTED] Sent: Sunday, August 24, 2003 2:21 PM To: [EMAIL PROTECTED] Subject: Java Question I've been trying to compile my BLB (Business Logic Bean) and have been getting errors during compilation. I haven't a clue as to how I could debug this. Any assistance would be appreciated. Thanks in advance. - Mitesh Error Messages during compilation: [javac] Compiling 2 source files to C:\jakarta-tomcat-4.1.27\webapps\benchmark\WEB-INF\classes [javac] C:\jakarta-tomcat-4.1.27\webapps\benchmark\WEB-INF\src\net\reumann\OrgId Service.java:56: stmt is already defined in execute(net.reumann.DataHash) [javac] Statement stmt = conn.createStatement(); [javac] ^ [javac] C:\jakarta-tomcat-4.1.27\webapps\benchmark\WEB-INF\src\net\reumann\OrgId Service.java:57: rs is already defined in execute(net.reumann.DataHash) [javac] ResultSet rs = stmt.executeQuery(SELECT FACIL_ID, FACIL_NAME, FACIL_NAME_SHORT, ORG_ID FROM FACILITY WHERE FACIL_ID = ' + facilId + '); [javac] ^ [javac] 2 errors Here is the code from my BLB: package net.reumann; import java.io.*; import java.util.ArrayList; import javax.servlet.*; import javax.servlet.http.*; import java.sql.*; import javax.sql.*; import net.reumann.*; import org.apache.struts.action.Action; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; import org.apache.struts.action.ActionForm; import org.apache.log4j.*; import org.apache.commons.beanutils.BeanUtils; public class OrgIdService implements Serializable { //Declare and initialize variables Connection conn = null; Statement stmt = null; ResultSet rs = null; ArrayList facilList = new ArrayList(); //The execute() method of OrgIdService is called by OrgIdAction to execute a query against the SS Test DB public ArrayList execute(DataHash beanHash) { //Get mode from DataHash int mode = beanHash.getMode(); try{ switch (mode) { case 0: Class.forName(oracle.jdbc.driver.OracleDriver); conn = DriverManager.getConnection(jdbc:oracle:thin:@sources:1521:TEST,Test1 234,Test1234); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(SELECT DISTINCT FACIL_ID FROM FACILITY); //Read ResultSet into instance of FacilBean and add to facilList Array object while (rs.next()) { FacilBean facil = new FacilBean(); facil.setFacilId(rs.getString(FACIL_ID)); facilList.add(facil); } //Close ResultSet and Connection objects rs.close(); conn.close(); case 1: //Extract the facilId from the DataHash to query the FACILITY table String facilId = (String) beanHash.get(FacilId); Class.forName(oracle.jdbc.driver.OracleDriver); conn = DriverManager.getConnection(jdbc:oracle:thin:@sources:1521:TEST,Test1 234,Test1234); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery(SELECT FACIL_ID, FACIL_NAME, FACIL_NAME_SHORT, ORG_ID FROM FACILITY WHERE FACIL_ID = ' + facilId + '); //Read ResultSet into instance of FacilBean and add to facilList Array object while (rs.next()) { FacilBean facil = new FacilBean(); facil.setFacilId(rs.getString(FACIL_ID)); facil.setFacilName(rs.getString(FACIL_NAME)); facil.setFacilName(rs.getString(FACIL_NAME_SHORT)); facil.setOrgId(rs.getString(ORG_ID)); facilList.add(facil); } //Close ResultSet and Connection objects
RE: Disallow user to modify URL in browser address bar
If testview_srchpost.do and testtwoview_srchpost.do are valid action then you cannot restrict. This means testview_srchpost.do, esttwoview_srchpost.do are in Struts Config File If that testtwoview_srchpost.do not Valid action then It will go default page or Error Page Thanks Nazeer -Original Message- From: sriram [mailto:[EMAIL PROTECTED] Sent: Friday, August 22, 2003 2:16 AM To: 'Struts Users Mailing List' Subject: Disallow user to modify URL in browser address bar How to identify if user has manipulated the URL in Address Bar of the browser? For ex., the application displays a page with the following URL: http://localhost:8080/app/str/testview_srchpost.do Now, the user modifies the URL in the address bard. Instead of testview_srchpost.do, user types testtwoview_srchpost.do and clicks ENTER. I want to restrict such types of URL modification Struts application. I should take the user to a default access denied page when ever user does such changes. How to identify this action of the user? Pl. give some ideas. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Bypassing Form Validation
There are 2 ways to solve this problem 1. through Javascript 2. in FormBean 1. Write the even on the Onsubmit of the form form name=DDD action=abc.do onSubmit=return CallSomeJAVAScript() on this javascript method return false when cancel is clicked. 2. On Validate method of the form bean you can check the Cancel button clicked if yes then return or do validation. Thanks Nazeer -Original Message- From: David Stemm [mailto:[EMAIL PROTECTED] Sent: Friday, August 22, 2003 12:39 PM To: Struts Users Mailing List Subject: Bypassing Form Validation I'm having trouble trying to cancel out of a form. I have a cancel button that looks like this: html:submit title=Cancel value=Cancel property=submit tabindex='24' onclick=bCancel=true;/ and while the onclick event does cancel out the javascript validation it still goes ahead and performs the server-side validation and I get errors saying certain fields are required, etc. I'm using a DynaValidatorForm and my action class inherits from DispatchAction. Anybody have any ideas? David Stemm - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Update button on a form
Writing a javascript on the onclick Event may work. Thanks Nazeer -Original Message- From: David Thielen [mailto:[EMAIL PROTECTED] Sent: Thursday, August 07, 2003 12:44 PM To: Struts-Users Subject: Update button on a form Hi; I have a form with a submit, reset, and update button. How do I handle control of the update button (go to a different action)? thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Application Design Document
There Struts Diagram in WSAD5.0 Which I ofen use to draw navigation Other tools like Struts Studio are also helpful. Thanks Nazeer -Original Message- From: Tarek M. Nabil [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 05, 2003 10:07 AM To: Struts (E-mail) Subject: Application Design Document Hi everyone, I just finished developing a web application using Struts and our client is asking us to provide a design document for the application. I was wondering, if among the struts community, there's a certain template or even ideas for how such a document should look like and what it should include. I was especially thinking of a diagram that illustrates the actions and their relationship with the JSP's and the Model. Does such diagram exist? And if yes, are there tools to generate it? By the way, if there's nothing standard, then I would certainly appreciate any individual experiences. Thanks, Tarek M. Nabil - 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]