Re: [OT] Beer
I'm a homebrewer and whenever I'm asked about American beer I respond with something heard a few yrs ago... American beer is like having sex on a boat... It's f*ckin close to water -- Sloan - Original Message - From: Joe Hertz [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, December 12, 2003 10:31 AM Subject: RE: [OT] Beer Normally I agree. American Laagers are pretty much identical. I've been known to ask what is on tap, hear the list, and then order a pepsi. A Sam Adam's Double Bock however, and I am quite happy. I think Sam Adams at one point claimed to be the only American brewer who exported to Germany. -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 10:13 AM To: Struts Users Mailing List Subject: RE: [OT] Beer I still stand by my original assertion: ALL American beer is recycled! Is it any wonder that I quit drinking the stuff when I moved from England to America. -Original Message- From: Ben Anderson [mailto:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 9:05 AM To: [EMAIL PROTECTED] Subject: RE: [OT] Beer alright, didn't think I'd need to chime in, but someone's gotta defend the black gold: representing the great city of Pittsburgh: Iron City Beer From: Chappell, Simon P [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: [OT] Beer Date: Fri, 12 Dec 2003 08:57:50 -0600 I think that these replies kinda prove my point! :-) (Notice how no one ever defends American beer!) Simon snip - 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] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RadioButtons
I've got an action that populates an ActionForm so that when a page is displayed, it is already filled in (think edit functionality). But for some reason the radio buttons are not being checked. I remember reading about this a while ago but can't remember why it is occurring. Could someone fill me in on how to get this to work? Thanks... -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Radio Buttons (answered my own questions)
One of my developers has some things mis-configured. Please ingore the last email. I got it working... Sorry! This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Re: How can i simply show a form property as a simple text
I'm got almsot the same question. I populate a form bean in an action and then display the page with the populated form bean. I want to use c:out to display one of the values in the form bean but I'm not sure where to look for the value. I have the action scope set to request and the bean name is bitmap_form, so I figured: c:out value=${requestScope.bitmap_form.FORMER_FILE_SRC}/ would do it... but it doesn't. FORMER_FILE_SRC is the property of the form bean that I wish to display... Any ideas? - Original Message - From: Slattery, Tim - BLS [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 10:48 AM Subject: RE: How can i simply show a form property as a simple text From: Florent LOTHON [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 03, 2003 9:25 AM In an editing form page How can i simply show a form property as a simple text (not in an html:xxx input tag). Either the Struts bean:write ... tag or the JSTL c:out ... tag will do what you want. -- Tim Slattery [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Display img from DB
I've got some img files stored in a database as byte[]'s. Is there any easy way to get display the images in an HTML page? I figure I will have to write a custom tag for the img retrieval, but I can't just dump the byte[]. How do you go about doing this? Thanks! -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Re: Bypassing Form Validation
If you want to validation to be turned off in both javascript and server side you ahve to use the html:cancel tag You will not be able to set the property for this tag because if you do, struts won't know where to look to find the submittal to see if it should or shouldn't do the server side validation. Your onClick could will work fine for the javascript validation but you will not need it if you use html:cancel because it will put that code in there for you. -- Sloan - Original Message - From: David Stemm [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, August 22, 2003 12:38 PM 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 This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
FormBean population
I've got a form bean that is of type DynaValidatorForm. In the past I had been using DynaActionForm and when I wanted to display a form with values already populated (from, say, a DB query) I would link to an action that would populate the formbean and then display then jsp page which would then have access to the form bean's values. Now that I have switched over to DynaValidatorForm, when I call my action to populate the form bean it thinks it is a submit, does a validation check, and complains that the fields are empty (which they are at the time of the submit because the action to populate the form bean has not run yet). I think I may be going about this the wrong way. How does one populate a DynaValidatorForm bean so that a jsp page can display the values and not invoke the initial validation check? -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Re: Session expired
How about a filter? That is what I use. Anything within a certain path first gets checked by my filter and if the user doesn't have a valid session object it redirects them to the login page... This way the code doesn't even know it is happening... You define one in your web.xml like so: filter filter-nameSessionFilter/filter-name filter-classcom.symbol.mc.oms.servlet.SessionFilter/filter-class /filter filter-mapping filter-nameSessionFilter/filter-name url-pattern/app/*/url-pattern /filter-mapping This way anything within the /app dir goes through the filter first... - Original Message - From: Filip Polsakiewicz [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 8:12 AM Subject: RE: Session expired My problem is, that I already have something around 60 jsps. Now it would be nice to have a workaround so that i don't have to adapt all my jsps and actions. -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 12:58 PM To: Struts Users Mailing List Subject: Re: Session expired What if you check from your action before redirecting to a jsp ? Filip Polsakiewicz wrote: Hi, is there any way to redirect y user to a jsp if the session is expired without checking for an expired session within each single jsp? 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] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Session expired
First off let me state that mine is a bit complicated since it gets some config info from a static object I stripped out what I could to make it more simple...but the whole version of mine gets the redirect url and if it is enabled or not from a static configuration object that is created via a plugin that uses Digester The example below is as simple as it gets. If a session object does not exist and the specific object within the session does not exist (in this case, a user object defined by USER_OBJECT), it redirects to the index.jsp. Otherwise it just lets the filter continue down the chain of filters(the correct thing to do if the user is valid). In writing your own you will prob. want to abstract the page to redirect to as well as the object to look for in the session to make everything more configurable You could also go a step further and check the roles within the user object. Though I do this on a per action basis within the struts-config.xml file via a SecureAction object that I've created. This allows for a lot of cool tricks like cascading up the action chain to a point where the user finally has proper access rights anyway... here is the code: import java.io.IOException; import javax.servlet.*; import javax.servlet.http.*; import org.apache.log4j.Logger; public class SessionFilter implements Filter { private static final Logger log = Logger.getLogger(SessionFilter.class); private ServletContext context = null; /** * Initialize the SessionFilter with the FilterConfigurate from the * web.xml file * * @param _filterConfig The Filter Configuration */ public void init(javax.servlet.FilterConfig _filterConfig) { context = _filterConfig.getServletContext(); } /** * Called when the filter needs to be executed * * @param _request The ServletRequest * @param _response The ServletResponse * @param _chain The FilterChain */ public void doFilter(ServletRequest _request, ServletResponse _response, FilterChain _chain) throws IOException, ServletException { String redirectFailure = /index.jsp; HttpSession session = ((HttpServletRequest)_request).getSession(); // the object name to look for should be in the configuration... if ((session == null) || (session.getAttribute(USER_OBJECT)== null) ) { context.getRequestDispatcher(redirectFailure) .forward(_request,_response); log.debug(Access denied. Redirecting to +redirectFailure); } else { _chain.doFilter(_request, _response); } } /** * Doesn't do anything */ public void destroy() {} } - Original Message - From: Mike Deegan [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 3:43 PM Subject: Re: Session expired Sloan, Can you provide example code from com.symbol.mc.oms.servlet.SessionFilter Or is that asking too much ?? TIA, Mike - Original Message - From: Sloan Seaman [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 12:17 PM Subject: Re: Session expired How about a filter? That is what I use. Anything within a certain path first gets checked by my filter and if the user doesn't have a valid session object it redirects them to the login page... This way the code doesn't even know it is happening... You define one in your web.xml like so: filter filter-nameSessionFilter/filter-name filter-classcom.symbol.mc.oms.servlet.SessionFilter/filter-class /filter filter-mapping filter-nameSessionFilter/filter-name url-pattern/app/*/url-pattern /filter-mapping This way anything within the /app dir goes through the filter first... - Original Message - From: Filip Polsakiewicz [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 8:12 AM Subject: RE: Session expired My problem is, that I already have something around 60 jsps. Now it would be nice to have a workaround so that i don't have to adapt all my jsps and actions. -Original Message- From: Kwok Peng Tuck [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 12:58 PM To: Struts Users Mailing List Subject: Re: Session expired What if you check from your action before redirecting to a jsp ? Filip Polsakiewicz wrote: Hi, is there any way to redirect y user to a jsp if the session is expired without checking for an expired session within each single jsp? 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
tiles and c:redirect
I have a .jsp file that is inserted via the tiles:insert tag. In this file is a c:redirect (much like the logic:redirect) tag that should do a redirection. The redirection is not occurring. I have checked the path, and even tested a blank page that did nothing but redirect and it still does not work. Is this an issue with tiles? -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
DynaActionForm reset
I have an action that used a form bean (suggestion_form). When I go to my edit page, my code populates the bean and displays the page. Works great. If I go to my add page (which in the struts-config uses the same form bean) the page gets the values from the populated bean from the edit page even though my code that populates the bean was never called. I'm guessing that somehow the reset() on the DynaActionForm is not being called even though the call to the add page is a new request and therefor the form bean still has the values that I set in it What am I doing wrong??? -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Re: DynaActionForm reset
Yep.. that would do it... thanks! -- Sloan - Original Message - From: Suzette Daniel [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 2:33 PM Subject: RE: DynaActionForm reset Be sure to set the scope on your action mapping to request, it is session scope by default. Suzette H. Daniel Java Developer/Web dept 770 416.9222 ex: 5041 -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 29, 2003 2:26 PM To: Struts Users Mailing List Subject: DynaActionForm reset I have an action that used a form bean (suggestion_form). When I go to my edit page, my code populates the bean and displays the page. Works great. If I go to my add page (which in the struts-config uses the same form bean) the page gets the values from the populated bean from the edit page even though my code that populates the bean was never called. I'm guessing that somehow the reset() on the DynaActionForm is not being called even though the call to the add page is a new request and therefor the form bean still has the values that I set in it What am I doing wrong??? -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Why not to use Action chaining ?
Though that is true, it can be avoid if you write your chainer properly. You can have it Dechain and actually invoke a forward to the new action. Also, you can write an Action that just invokes objects in a linked list mannor and have each action called that way. There are really lots of options for chaining As stated in an email a week or so ago, I have a system that does all of the above and more but I'm still trying to get permission from my company to release it :( -- Sloan - Original Message - From: Siva [EMAIL PROTECTED] To: Jing Zhou [EMAIL PROTECTED] Cc: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 10:28 AM Subject: Re: Why not to use Action chaining ? thanks a lot Jing Zhou, I will try this . Siva Jing Zhou wrote: - Original Message - From: Siva [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 5:14 AM Subject: Re: Why not to use Action chaining ? Thanks Alen, Ted Husted (Struts in Action) says that the action chaining in the dark side of Struts. The problem he mentioned is that when the second action is being invoked, the form is being 'repopulated' with the initial form values that the form had when it was passed to the first action Since I am new to struts, I am not able to grasp it clearly. You can find the info related to this in Struts FAQ. I am just wondering what is the alternate solution. There are two alternatives to my knowledge: 1) Refactoring Design: Put common functions into a separate class and then call the common functions from your action classes if you need. 2) Controller Delegation Model: In one action class, you could find another action instance the same way as the RequestProcessor find it and then call the execute method on the action instance. The second way is very suitable for tools when designers could organize their actions without any overlap functions. The performance gain is apparent: no repopulated, no revalidated form beans. Thanks again, siva Jing Netspread Carrier http://www.netspread.com Alen Ribic wrote: Maybe I haven't came across this before or I don't understand but why wouldn't you wanna use action chaining? I just jump from one action to another until I have all client requested baggage. --Alen - Original Message - From: Siva [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 11:54 AM Subject: Why not to use Action chaining ? Friends, Could anyone of you tell me why we ahuld not use Action chaining in struts framework ? I neet to do two different actions for a user action. how can i wachieve it without action chaining? Thanks in advance for your help. Sivakumar - 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] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Workflow Proposal for Struts
Jacob, Can't you pull off workflow (to some degree) with action chaining? Here is the system I have devised (this is part of a much larger architecture that does a lot of other cool things like validation of struts config files to ensure that specified actions have required forwards and set-properties (nice for multi-developer env's)): Here is an example I have in my struts config: action-mappings action path=/app/promoFlight/addChain className=com.symbol.mc.struts.wrapper.chain.ChainActionMapping type=com.symbol.mc.struts.wrapper.chain.ChainAction name=addForm set-property property=CHAIN_PROPERTY_NAME value=ACTION_POINT/ set-property property=CHAIN value=Cancel: /app/promoFlight/managePage/ set-property property=CHAIN value=Create a List: /app/promoFlight/storePage/ set-property property=CHAIN value=Add Promotion Flight: /app/promoFlight/add/ forward name=PAGE_ACTION_FAILURE path=/app/promoFlight/addPage.do/ /action The .jsp/html page then has a submit button named ACTION_POINT. This action supports three different action points depending on thier value. If Cancel, it goes to /app/promoFlight/managePage, and so on. In case of an error in the ChainAction it uses PAGE_ACTION_FAILURE. I can also set FORWARD_FAILURE_NAME which allows me to specify the name of a forward that, if returned from one of the chained pages, will stop the chain. This exists because not only can I just redirect to a specific page, I can do things like: set-property property=CHAIN value=Cancel: /app/promoFlight/managePage, /app/promoFlight/savePage, etc/ Is this what you are kinda looking for? -- Sloan - Original Message - From: Hookom, Jacob [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 5:11 PM Subject: [OT] Workflow Proposal for Struts http://jakarta.apache.org/struts/proposal-workflow.html Is there any pursuit in this or does it follow the direction that 1.2 will be heading or is this the proposal for the commons-workflow? Jacob Hookom Senior Analyst/Programmer McKesson Medical-Surgical Golden Valley, Minnesota http://www.mckesson.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Workflow Proposal for Struts
I'm working on getting the OK from my company to release the code (as it was developed for one of our projects). I'll keep you posted but it shouldn't take long. They have let me release stuff before... The validation piece is the core of another system I've developed that does a lot more. If you just want the validation piece that is cool as it is designed to be its own entity. The other system, ActionMCP (Master Control Program (think Tron, the movie)) adds to the validation system by supporting configurable resource chaining. Say you are using JDO and you don't want to have to getPersistenceManager() in every action. At the same time, you also have multiple objects that you want to fire off and if one of them fails you want to rollback everything. The objects that fire off, and their order can be set within struts as well as being wrapped by jdo like so: action path=/test className=com.symbol.mc.struts.mcp.ActionMCPMapping type=com.symbol.mc.struts.mcp.ActionMCP name=jdoTestBean set-property property=ACTION_TYPE value=JDO, PROCESSOR/ set-property property=ACTION_PROCESSOR value=com.symbol.mc.oms.common.struts.action.DollarSpent/ set-property property=ACTION_PROCESSOR value=com.symbol.mc.oms.common.struts.action.SaveDollar/ forward name=PAGE_ACTION_FAILURE path=/testMdx.jsp/ forward name=PAGE_ACTION_SUCCESS path=/mdx.jsp/ /action Doesn't show much really, but now, say I want the page to work only in a secure env. All you do is change ACTION_TYPE to: set-property property=ACTION_TYPE value=SECURE, JDO, PROCESSOR/ objects in the list get wrapper by their predecessor. Ok, so now you want to do Redirects (Something I have seen talked about a lot in the forums but never really implemented ;)) Change ACTION_TYPE to: set-property property=ACTION_TYPE value=SECURE, JDO, PROCESSOR, REMAP/ and add: set-property property=MAPPED_FORWARD value=PAGE_ACTION_SUCCESS:/app/test1:/app/test2/ This will take any request from /app/test1 and change the value of PAGE_ACTION_SUCCESS to /app/test2 without having to change your Action's code. It does a lot of other things (Chaining, MDX, wait pages), but this email is getting long... -- Sloan - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 8:39 AM Subject: Re: [OT] Workflow Proposal for Struts I like the idea of validation of struts-config. Could you send me that if you don't mind? sandeep --- Sloan Seaman [EMAIL PROTECTED] wrote: Jacob, Can't you pull off workflow (to some degree) with action chaining? Here is the system I have devised (this is part of a much larger architecture that does a lot of other cool things like validation of struts config files to ensure that specified actions have required forwards and set-properties (nice for multi-developer env's)): Here is an example I have in my struts config: action-mappings action path=/app/promoFlight/addChain className=com.symbol.mc.struts.wrapper.chain.ChainActionMapping type=com.symbol.mc.struts.wrapper.chain.ChainAction name=addForm set-property property=CHAIN_PROPERTY_NAME value=ACTION_POINT/ set-property property=CHAIN value=Cancel: /app/promoFlight/managePage/ set-property property=CHAIN value=Create a List: /app/promoFlight/storePage/ set-property property=CHAIN value=Add Promotion Flight: /app/promoFlight/add/ forward name=PAGE_ACTION_FAILURE path=/app/promoFlight/addPage.do/ /action The .jsp/html page then has a submit button named ACTION_POINT. This action supports three different action points depending on thier value. If Cancel, it goes to /app/promoFlight/managePage, and so on. In case of an error in the ChainAction it uses PAGE_ACTION_FAILURE. I can also set FORWARD_FAILURE_NAME which allows me to specify the name of a forward that, if returned from one of the chained pages, will stop the chain. This exists because not only can I just redirect to a specific page, I can do things like: set-property property=CHAIN value=Cancel: /app/promoFlight/managePage, /app/promoFlight/savePage, etc/ Is this what you are kinda looking for? -- Sloan - Original Message - From: Hookom, Jacob [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 16, 2003 5:11 PM Subject: [OT] Workflow Proposal for Struts http://jakarta.apache.org/struts/proposal-workflow.html Is there any pursuit in this or does it follow the direction that 1.2 will be heading or is this the proposal for the commons-workflow? Jacob Hookom Senior Analyst/Programmer McKesson Medical-Surgical Golden Valley, Minnesota http://www.mckesson.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: [OT] Workflow Proposal for Struts
The Service and Call stuff looks like SOAP ;) anyway... My system works like so: Replace ActionServlet with ActionMCPServlet so it can do all the validation stuff at startup. Use ActionMCP and ActionMCPMapping for the struts actions. If you just want to do individual things (say, just JDO) there are JDOAction wrappers that can be used independently of ActionMCP. ActionMCP will also allow you to extend it and have your object get called between the initialization and destroying of the services (which I called wrappers for some reason *shrugs shoulders*). To do this you implement ActionMCPWrapper which has init() and destroy() methods. This allows things like JDO transactions to span other wrappers. It has cut my development time significantly. Esp. since I added wrapper event listeners. This way anything that throws an exception can get caught elsewhere. So say you action does some JDO. You don't need to have the error catching in the action. You register a listener (I have generic ones) that will handle the error for you. This way I can do things like graceful degradation really easily Anyway... I'll see about getting this all on a website. I think it is very useful and I am looking for suggestions -- Sloan - Original Message - From: Hookom, Jacob [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 10:02 AM Subject: RE: [OT] Workflow Proposal for Struts I'm working on something similar for my company that works like ANT and is loaded via the ServiceLocator pattern. It allows you to say for storing an order, it is dependent on: validation, duplication check, and storage. Dependency mapping allows you to add some granularity to your tasks, and tasks (targets) are fired like the ServletFilter: public void invoke(Context context, TaskChain chain) throws Exception { ServiceRegistry sr = chain.getServiceRegistry(); Service s = null; Call c = null; try { // do pre processing s = sr.createService(test); c = s.createCall(sampleTask); c.invoke(context); chain.invokeNext(context); // do post processing } catch (Exception e) { // do error handling } finally { s.close(); c.close(); } } Jacob Hookom Senior Analyst/Programmer McKesson Medical-Surgical Golden Valley, Minnesota http://www.mckesson.com -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Thursday, July 17, 2003 8:22 AM To: Struts Users Mailing List Subject: Re: [OT] Workflow Proposal for Struts I'm working on getting the OK from my company to release the code (as it was developed for one of our projects). I'll keep you posted but it shouldn't take long. They have let me release stuff before... The validation piece is the core of another system I've developed that does a lot more. If you just want the validation piece that is cool as it is designed to be its own entity. The other system, ActionMCP (Master Control Program (think Tron, the movie)) adds to the validation system by supporting configurable resource chaining. Say you are using JDO and you don't want to have to getPersistenceManager() in every action. At the same time, you also have multiple objects that you want to fire off and if one of them fails you want to rollback everything. The objects that fire off, and their order can be set within struts as well as being wrapped by jdo like so: action path=/test className=com.symbol.mc.struts.mcp.ActionMCPMapping type=com.symbol.mc.struts.mcp.ActionMCP name=jdoTestBean set-property property=ACTION_TYPE value=JDO, PROCESSOR/ set-property property=ACTION_PROCESSOR value=com.symbol.mc.oms.common.struts.action.DollarSpent/ set-property property=ACTION_PROCESSOR value=com.symbol.mc.oms.common.struts.action.SaveDollar/ forward name=PAGE_ACTION_FAILURE path=/testMdx.jsp/ forward name=PAGE_ACTION_SUCCESS path=/mdx.jsp/ /action Doesn't show much really, but now, say I want the page to work only in a secure env. All you do is change ACTION_TYPE to: set-property property=ACTION_TYPE value=SECURE, JDO, PROCESSOR/ objects in the list get wrapper by their predecessor. Ok, so now you want to do Redirects (Something I have seen talked about a lot in the forums but never really implemented ;)) Change ACTION_TYPE to: set-property property=ACTION_TYPE value=SECURE, JDO, PROCESSOR, REMAP/ and add: set-property property=MAPPED_FORWARD value=PAGE_ACTION_SUCCESS:/app/test1:/app/test2/ This will take any request from /app/test1 and change the value of PAGE_ACTION_SUCCESS to /app/test2 without having to change your Action's code. It does a lot of other things (Chaining, MDX, wait pages), but this email is getting long... -- Sloan - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, July 17, 2003 8:39 AM Subject: Re: [OT] Workflow Proposal for Struts I
DynaValidatorForm
Why when I do a : bean:write name=addForm property=NAME/ It works fine. But if I do a c:out value=${addForm.NAME}/ or c:out value=${sessionScope.addForm.NAME}/ I get: [ServletException in:/app/promoFlight/add_body.jsp] An error occurred while evaluating custom action attribute value with value ${sessionScope.addForm.NAME}: Unable to find a value for NAME in object of class org.apache.struts.validator.DynaValidatorForm using operator . (null)' I thought they were equivilant... -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
html:select
If a user selects something from a html:select field and the next time the pages loads I want to get the value that they selected, how do I go about do this? I know that if I used html:option struts would select the correct option for me, but in my case the option tags get populated everytime by javascript so I need to get the selected option value from the bean that was set by struts... Thanks!! -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Re: Best place for security checks in Struts?
You could have a class that is an Action (say, named SecureAction) and then have all of the actions in the struts file extend SecureAction and implement a method called executeSecure() (not execute()!) What then happens is your action in the Strust config (say, named ShowUser) gets called by Struts but since it extends SecureAction, Struts calls SecureAction's execute(). It then checks security and if it's good it calls executeSecure() which is the method that ShowUser overwrote. If the security doesn't pass, then SecureAction never calls executeSecure... and there ya go. You can then define the security on a per action basis by making your own ActionMappping object and doing something like: set-property property=ROLE value=ADMIN/ That is how I did it for a while and it worked great... -- Sloan - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 2:44 PM Subject: Re: Best place for security checks in Struts? This is the requestProcessor. Sorry for that. I am busy doing work and then I answer a question... The way I think of it is that there is a requestProcessor for each struts-config. (You declare it here). So if you have multiple modules, you could theoretically have a different processor for each one. sandeep --- David Erickson [EMAIL PROTECTED] wrote: And which class is the procesRoles method in? - Original Message - From: Sandeep Takhar [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 08, 2003 9:47 AM Subject: Re: Best place for security checks in Struts? There must be a diagram that shows all the calls before it actually hits execute() method. There are quite a few. If you have a base action you can override one of them processRoles seems to be a logical place... sandeep --- David Erickson [EMAIL PROTECTED] wrote: Hi I am setting up my webapp for security, had a big thread about it last week, we've implemented filters to handle all the static filters sitting around, but would also like to put some security into the struts actions themselves. I'm trying to figure out where the best place to implement the checks would be, if I need to extend the class that actually calls the actions, or if I should extend the base action and insert checks, or what the best thing to do would be. Somehow each of the actions needs to have a name assigned to it to check against as well, and the information will be pulled from a user bean stored in the session variable. Thanks in advance! -David - 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] - 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] This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Nested tags : trying to get recursion to work
What does yout struts config file look like? Sounds like that is where the problem is... Also, you can't just start with a nest tag (to my knowledge) you have to have it in a nested:form or nested:root, but I may be wrong. The docs are a bit thin and I can't even get the examples to work properly -- Sloan - Original Message - From: Pratima Aiyagari [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 02, 2003 6:33 PM Subject: Nested tags : trying to get recursion to work I am trying to get recursive inclusion to work with the nested tags. Here is what I'm trying to do: I have a directory, which might have a bunch of files or more directories inside of it. Just like any regular directory structure. And I need to display all the directories and the files inside each. In main.jsp: nested:nest property=directory jsp:include page=recursiveDirectories.jsp / /nested:nest There is a bean in the request whose getter [getDirectory] method returns a directory. So, this should be fine. In recursiveDirectories.jsp nested:root readflag=[nested:write property=readFlag/] /nested:root The directory bean which is now passed to nested:root has a getReadFlag method. So this should work ? Or not .. :-/ I get a strange exception. It says Cannot find bean blank in any scope Please see end of this post for the exact exception. It says it can't find some bean, but no indication of what that might be .. Any help appreciated! Pratima === org.apache.jasper.JasperException: Cannot find bean in any scope at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 48) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:684) at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch er.java:575) at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher .java:498) at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8 22) at org.apache.jsp.queryInvReport_jsp._jspx_meth_nested_nest_0(queryInvReport_js p.java:1470) at org.apache.jsp.queryInvReport_jsp._jspService(queryInvReport_jsp.java:735) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:2 04) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher. java:684) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch er.java:432) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher .java:356) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10 69) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces sor.java:455) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application FilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh ain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja va:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja va:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180 ) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok eNext(StandardPipeline.java:643) at
nested tags
Has anyone every gotten the nested tags to work like in the Monkey Tree examples? I can't even get the examples to work. It seems like the iterator tag has a bug in it... It doesn't seem to iterate to the next object after it comes out of the recursion... -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
Nested Tag
I'm trying to do a tree using the nested tags and I'm having some issues. I've got a NodeBean (like the TreeBean in the monkey bean example) with the following: public NodeBean() { key=MonkeyTree; value=MonkeyTree; NodeBean n1 = new NodeBean(1, 1); NodeBean n2 = new NodeBean(2, 2); NodeBean n3 = new NodeBean(3, 3); NodeBean n4 = new NodeBean(4, 4); addChild(n1); n1.addChild(n3); addChild(n2); n2.addChild(n4); } And my .jsp looks like: nested:form action=/testTree2.do jsp:include page=treeNode.jsp/ /nested:form and (treeNode.jsp): nested:root DL nested:iterate property=children DDFONT size=-2 nested:write property=ancestry /FONT nested:writeNesting/ jsp:include page=treeNode.jsp/ /DD /nested:iterate /DL /nested:root But the output I get is: 1 children[0] 3 children[0].children[0] 2 children[1] 3 children[0].children[0] You can see that node 2 is showing a the child of node 1 when it should (as in the java code) clearly be node 4. Can anyone help me as to why this is happenning? Is it a bug in the nested tag? -- Sloan This email has been scanned for all viruses by the MessageLabs Email Security System. For more information on a proactive email security service working around the clock, around the globe, visit http://www.messagelabs.com
logic:notEmpty
I want to use the logic:notEmpty tag to test if a collection I have is empty or not. The Collection is in the pageContext under the variable name barcodeList. The Docs for notEmpty say that name, property, and scope are not required but if I use the property attribute it complains that I need the name. If I use name, it compains that I need property. I would think I should just be able to do: logic:notEmpty property=barcodeList stuff /logic:notEmpty but this doesn't seem to work. What is the correct way? Thanks! -- Sloan This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com
Re: logic:notEmpty
But what isf the collection is directly inside of the page scope and not a value within a bean that is inside of the page scope? The name attribute is to get the value from the bean defined in the scope by the property attribute. What if the bean itself is the collection? Or, to put a spin on it, how would you check for the existence of a bean? -- Sloan - Original Message - From: Susan Bradeen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 9:26 AM Subject: Re: logic:notEmpty Oops, sorry about that ... I was thinking of the wrong tag! Yes, I use notEmpty, and use both name and property attributes. Susan Bradeen On 03/31/2003 09:19:18 AM Susan Bradeen wrote: I have used this tag, but I usually reference the name (formbean) and property together. At the very least, you *must* include the value attribute to make the logic comparison with your property value. Even if the tag picked up your property, what it is supposed to be comparing it to see if it is notEqual? Hope this helps, Susan Bradeen On 03/31/2003 09:01:50 AM Sloan Seaman wrote: I want to use the logic:notEmpty tag to test if a collection I have is empty or not. The Collection is in the pageContext under the variable name barcodeList. The Docs for notEmpty say that name, property, and scope are not required but if I use the property attribute it complains that I need the name. If I use name, it compains that I need property. I would think I should just be able to do: logic:notEmpty property=barcodeList stuff /logic:notEmpty but this doesn't seem to work. What is the correct way? Thanks! -- Sloan This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.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] This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: logic:notEmpty
The logic:notPresent tag did the trick Thanks! -- Sloan - Original Message - From: Susan Bradeen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 10:27 AM Subject: Re: logic:notEmpty I think there may be a few issues here ... First of all, notEmpty, I believe, checks for whether or not a String value is set for a specific bean property (checks for null or empty String). So I don't think you can use if for a collection as a whole. The notPresent tag may be better suited to this, although that may just check to see if the collection is in existence, not necessarily populated with values. In other words, the collection can be empty, but it is still present. I think. Have you tried using your collection as the name for the bean, and using some field in the collection as the property? This brings it more down to the level of what notEmpty is used for. All my properties are set from my formbean within the action that loads the jsp. So in my case, I have a collection object in my form, with its getters and setters, and the action does the ... myform.setMyCollection(someCollectionFromSomewhere); ... then, if the collection is null, the notPresent tag in the jsp will do whatever you need it to do. You can use the bean:define tags to set your page scoped collection to a variable which will be useable within your jsp, but I am not sure if that is what you are looking for? Susan Bradeen On 03/31/2003 10:02:44 AM Sloan Seaman wrote: But what isf the collection is directly inside of the page scope and not a value within a bean that is inside of the page scope? The name attribute is to get the value from the bean defined in the scope by the property attribute. What if the bean itself is the collection? Or, to put a spin on it, how would you check for the existence of a bean? -- Sloan - Original Message - From: Susan Bradeen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 9:26 AM Subject: Re: logic:notEmpty Oops, sorry about that ... I was thinking of the wrong tag! Yes, I use notEmpty, and use both name and property attributes. Susan Bradeen On 03/31/2003 09:19:18 AM Susan Bradeen wrote: I have used this tag, but I usually reference the name (formbean) and property together. At the very least, you *must* include the value attribute to make the logic comparison with your property value. Even if the tag picked up your property, what it is supposed to be comparing it to see if it is notEqual? Hope this helps, Susan Bradeen On 03/31/2003 09:01:50 AM Sloan Seaman wrote: I want to use the logic:notEmpty tag to test if a collection I have is empty or not. The Collection is in the pageContext under the variable name barcodeList. The Docs for notEmpty say that name, property, and scope are not required but if I use the property attribute it complains that I need the name. If I use name, it compains that I need property. I would think I should just be able to do: logic:notEmpty property=barcodeList stuff /logic:notEmpty but this doesn't seem to work. What is the correct way? Thanks! -- Sloan This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.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] This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.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] This email
Re: [OT] OJB or Hibernate??
Check out XORM and TJDO for opensource implementations of JDO. I use XORM and it works very well... -- Sloan - Original Message - From: Tim Shadel [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, March 31, 2003 4:26 PM Subject: Re: [OT] OJB or Hibernate?? For what it's worth, Here's a few links I found through Google: http://www.freeroller.net/page/ceperez/20021212 http://www.rollerweblogger.org/page/roller/20021212 Tim Bill Johnson wrote: *This message was transferred with a trial version of CommuniGate(tm) Pro* I'm curious which is the framework of choice? What the strengths are of each, etc.? Thanks, Bill __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.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] This email has been scanned for all viruses by the MessageLabs SkyScan service. For more information on a proactive anti-virus service working around the clock, around the globe, visit http://www.messagelabs.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts-config.xml
You can also have imultiple files and then have ANT use a skeleton struts-config.xml file to build the final file. Just use variable replacement in ANT to insert all the seperate files into one master file (that is how we do it) -- Sloan - Original Message - From: Joseph Fifield [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:26 PM Subject: RE: struts-config.xml If you are using 1.1, you can simply split the file into multiple files, and list each comma-delimited in web.xml. IIRC, this was new in 1.1b3. We have one for every major part of our application, and it required no additional code changes. Joe -Original Message- From: Pat Young [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:23 PM To: Struts Users Mailing List Subject: RE: struts-config.xml Yes, I have looked at sub-applications and we are considering it. Using sub-applications does have some technical considerations that have to be accounted for.I realize that we could use a merge feature of a versioning tool also. I was curious if anyone had any other creative ideas around this problem or if there was a feature in Struts that I had missed. Pat Young --- Mike Jasnowski [EMAIL PROTECTED] wrote: Well, version control considerations aside (for issues around merges when new struts-config.xml are checked in), Have you also looked at Struts sub-applications? Each can have it's own struts-config.xml. -Original Message- From: Pat Young [mailto:[EMAIL PROTECTED] Sent: Thursday, March 20, 2003 4:14 PM To: [EMAIL PROTECTED] Subject: struts-config.xml I am curious as to how others are working with the struts-config.xml file. I am working on a large project with a team of 8 other developers. So far we have over 200 actions. The struts-config.xml is becoming a bottle neck, because each developer needs to update the file at the same with entries into this file. Does anyone have any ideas as to how to make working with this file any easier? Thanks in advance. Pay Young __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! http://platinum.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts-config.xml
Here is a snipit of my struts-config.skeleton.xml: form-beans @core.formbean @campaign.formbean @promotion.formbean @promotionTypes.pantryLoading.formbean /form-beans action-mappings @core.action @campaign.action @promotion.action @promotionTypes.pantryLoading.action /action-mappings Here is the snipit from the build: Notes: there may be a better way to do this, this was quick and dirty Also, each individual developer has three files: struts-action.xml struts-formbean.xml validation.xml I use struts-action for the actions, struts-formbean for the formbeans, and I also build the validation file so that is what validation.xml is for target name=struts.config.build echo message=Building struts-config.xml/ delete file=${j2ee.struts}/ !-- struts-config.xml -- !-- build the struts-config.xml -- copy file=${j2ee.struts.skeleton} tofile=${j2ee.struts}/ loadfile property=struts.config.core.action srcFile=${src.core}/${j2ee.struts.action}/ loadfile property=struts.config.core.formbean srcFile=${src.core}/${j2ee.struts.formbean}/ replace file=${j2ee.struts} token=@core.action value=${struts.config.core.action}/ replace file=${j2ee.struts} token=@core.formbean value=${struts.config.core.formbean}/ You should be able to get this gist from that Works very well -- Sloan - Original Message - From: Dan Allen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 21, 2003 9:31 AM Subject: Re: struts-config.xml Sloan Seaman ([EMAIL PROTECTED]) wrote: You can also have imultiple files and then have ANT use a skeleton struts-config.xml file to build the final file. Just use variable replacement in ANT to insert all the seperate files into one master file (that is how we do it) Great idea! Who cares what the deployed struts-config.xml file looks like after all. Man, maybe struts developers could have saved the time and just relied on ant. Oh well, guess options are good. Mind you code post? Okay, I won't beat around the bush, can you post that snippet from your ant build file? I would be most appreciative! Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, [EMAIL PROTECTED] http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Real programmers just hate to get up in the morning, and contrary to Ordinary People, they're in better shape as it gets closer to nighttime. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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: Control Access
Use a servlet filter (lots of examples exist)... Just check the session to see if they have a valid one and if they don't redirect them to the login page. 3 lines in web.xml and aboue 10-20 lines of java... That's how I do it... -- Sloan - Original Message - From: mahesh kagitha [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 4:09 PM Subject: RE: Control Access Hi Siva, My question about navigation of successful/unsuccessful users...If I directly access any JSP other than login.jsp, then I should be redirected to login.jsp , a way of forcing user to authorization. Thanks mahesh. Jagadeesan,Sivakumar [EMAIL PROTECTED] wrote:Hi Mahesh: This is pretty simple when using struts. Have the Login Page to Submit to Login Action. Configure in the Struts-Config.xml the action mapping for LoginAction as SUCCESS --- Index.html FAILURE --- Login.jsp In the Login Action return SUCCESS if the login succeeds or return FAILURE if the login fails I am sorry I was in hurry so not able to give any code example. Let me know if I am not that clear --Siva -Original Message- From: mahesh kagitha [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 2:49 PM To: [EMAIL PROTECTED] Subject: Control Access Can any one please explain the following... I'm developing an application which has login page(JSP) to access the application and I should allow only the successfully logged in users to navigate my application otherwise direct to login page. My question here is... How can I do that.? Thanks in Advance. - Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Calendar tag lib
http://developer.iplanet.com/viewsource/husted_calendar/husted_calendar.html Is a really nice one... -- Sloan - Original Message - From: Anand M S [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 10:09 AM Subject: Calendar tag lib Hi All, Is there any calendar tag lib for date picker? any ideas? Thanks, Anand - 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]
Tile variable in a custom tag
Is there any way to get a variable passed to a tile into a custom tag within that tile? Example: I pass to the tile: tiles:put name=OBJECT_NAME value=node/ and then I want to so something like: pantryLoading:getBarcodeTree name=${OBJECT_NAME} property=nodeList scope=session/ -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: argh, confused now
You can chain them together... Jacob Hookom and I had a discussion about this a while ago. I wrote a ChainAction action that allows me to call multiple actions one after another and pass the same form info to all or them, or change form info along the way (to a minor extent).. Check the archives for the postings It allows me to do exactly what you are doing... You can also look at the Struts chaining project (just search google) but I think you have to implement proprietary executeChain() methods... -- Sloan - Original Message - From: Dan Allen [EMAIL PROTECTED] To: Struts-User List [EMAIL PROTECTED] Sent: Friday, March 14, 2003 1:53 PM Subject: argh, confused now Okay, I think I got too much information and now I am confused all over again. I have a 3 part form. When the user signs up he/she has to run through all 3 pages, but when the user is editing his/her account, they can do it one page at a time. This makes for a lot of different actions. /CreateAccount /RegisterMember /RegisterCompany /RegisterCompanyMeta /EditAccount /EditMember /EditCompany /EditCompanyMeta all with seperate Action classes or all combined in a DispatchAction? I think it makes too much sense and now I am lost. Sorry for such a generic question, but does anyone have an idea for the path of least resistence given this scenario? Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, [EMAIL PROTECTED] http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - I am the GOD.the GOD...of house! -- Leeloo - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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: Tiles and html-el
Thanks! Worked like a charm! - Original Message - From: Derek Richardson [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 6:39 PM Subject: RE: Tiles and html-el Try: t:importAttribute name=TARGET_PAGE / html-el:link page=${TARGET_PAGE}blah/html-el:link t being the prefix for the tiles taglib. Derek Richardson -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:14 PM To: Struts Users Mailing List Subject: Tiles and html-el I've got an html-el:link inside a tile and I need to get one of the variables that was passed to the tile into the link being created by the html-el:link How do I reference the variable that was passed in? Example: on one jsp page: tiles:insert page=/app/global/forms/barcodeList.jsp tiles:put name=TARGET_PAGE value=/app/campaign/mainPage.do/ /tiles:insert in tile page: html-el:link page=${TARGET_PAGE}blah/html-el:link I know that the above doesn't work... How would I go about getting it to work? I have to use html-el because in the real page I have other variables going into the page= Thanks!! -- Sloan - 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]
Making a Tree
Are there any struts/jsp tags that help in making a tree structure? Not a JavaScript one but one that will expand when you click each link from doing a call to an Action? I could do nested logic tags over returned Collections, but I was wondering if there was a better way? -- Sloan yeah.. I know... Only God can make a tree - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles and html-el
I've got an html-el:link inside a tile and I need to get one of the variables that was passed to the tile into the link being created by the html-el:link How do I reference the variable that was passed in? Example: on one jsp page: tiles:insert page=/app/global/forms/barcodeList.jsp tiles:put name=TARGET_PAGE value=/app/campaign/mainPage.do/ /tiles:insert in tile page: html-el:link page=${TARGET_PAGE}blah/html-el:link I know that the above doesn't work... How would I go about getting it to work? I have to use html-el because in the real page I have other variables going into the page= Thanks!! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:link ties the model to the view
Take a look at html-el:link as it may provide exactly what you are looking for.. Example: logic:iterate id=element name=listSubcategoryForm property=visibleCategories type=cannot reveal package name.SubcategoryModel trtd html-el:link name=element property=params page=/editSubcategory.do?${visibleCategories}html:img border=0 srcKey=img.edit//html-el:link /td /tr /logic:iterate - Original Message - From: Tarek M. Nabil [EMAIL PROTECTED] To: Struts (E-mail) [EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 2:26 PM Subject: html:link ties the model to the view Hi everyone, I've been using Struts for a while, and I think it's the best thing since servlets. Today, though, I ran into a problem that when I tried to implement with Struts, I found the solution to be rather dissappointing. Or maybe it's just me, and I couldn't figure out the best way to do it. I have a JSP that lists a number of elements, and beside each element, there's a link to another page where the user can edit this element. I use a model class to retrieve a Vector of instances from the class that encapsulates that element. I use the logic:iterate tag to iterate over this Vector and show the elements. When I tried to implement the link that will point to the page where the element can be edited, I found out that the html:link tag has a strange way of getting the parameters to be appened to the link. If you want to send more than one parameter then you need to provide a Map of the parameter names and values. Since I'm iterating over a collection, the only way to do that is to provide this Map from the instances in this collection for every element. But that would mean that my model (Class whose instance is in the Vector) has to know the names of the request parameters I'm sending. Isn't that some sort of coupling between the model and the web tier? Or am I missing something here? I'll provide the code here to help explain my point...I've only included the element in question. logic:iterate id=element name=listSubcategoryForm property=visibleCategories type=cannot reveal package name.SubcategoryModel trtdhtml:link name=element property=params page=/editSubcategory.dohtml:img border=0 srcKey=img.edit//html:link/td /tr /logic:iterate So, I need SubcategoryModel to implement a method called getParams() to return a java.util.Map that contains the request parameters and their values. That would essentially mean that SubcategoryModel knows the name of the request parameters, which is not that good. I don't have another way to do it. Can anyone help? Thanks in advance. Tarek M. Nabil Software Engineer ITWorx [EMAIL PROTECTED] Free Zone, Area 7 (B), Block (J), Nasr City, Cairo, Egypt TEL.: 20-2-2766226 http://www.itworx.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]
Page Loading.. Please Wait
I need to have one of the Request Processing... Please wait type of things for an action I have that takes about 10 seconds to run If I was doing straight servlets I would write some javascript/dhtml stuff I found on the web to display the message and then flush the output stream.. then do the rest of the processing and then again flush the output stream to hide the Request Processing... stuff. How can I pull something like this off in Struts? Do I just grab the output stream from the response object or is there a better way to do this whole thing? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] JDBCRealm question
I had the same issue and from what I could find, you had to stick to using a text field. I ended up writing my own security system that was just an extension off of the ideas supported by Struts. It only takes a few hours to do.. Just put a User bean in the session when the person logs on and then write your own isUserInRole() tag to check the bean in memory... Pretty simple... - Original Message - From: Dan Allen [EMAIL PROTECTED] To: Struts-User List [EMAIL PROTECTED] Sent: Sunday, March 09, 2003 2:14 PM Subject: [OT] JDBCRealm question This is a simple one, pardon the request for advice. In the specs for JDBCRealm it talks about a username column being in the users table and in the user_role table. Does this mean that the username column has to be the primary key in the users table and not a user_id?? I thought it was bad design to make a text field a primary key since it means that it would have to be updated in two places if the user changed usernames, or are we sticking with the requirment that users can't change usernames or that it is an uncommon task? Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, [EMAIL PROTECTED] http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Frodo]: He deserves death. [Gandalf]: Deserves it! I daresay he does. Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 do you keep your session junk free?
I kinda have a class that does that if you want. I have an Action called ChainAction that can call N number of actions in a row and passes the same form and request info through all the actions. The last action in the chain is then used to do a foward to whatever. This is how I control all application flow via the struts-config file. Example: action path=/app/campaign/promotion/type/pantryLoading/introAddChain className=com.symbol.mobilecommerce.analysis.struts.ChainActionMapping type=com.symbol.mobilecommerce.analysis.struts.ChainAction name=pantryLoadingIntro set-property property=ROLE value=admin/ set-property property=PROPERTY_NAME value=action/ set-property property=CHAIN value=Do Delete : /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/deleteBitmapAdd, /app/campaign/promotion/type/pantryLoading/introAddPage/ set-property property=CHAIN value=Add Bitmap : /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/addBitmapAdd, /app/campaign/promotion/type/pantryLoading/introEditPage/ set-property property=CHAIN value=Next: /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/messageTypeAddChain/ forward name=PAGE_CHAIN_ERROR path=/app/campaign/promotion/type/pantryLoading/introAddPage.do/ forward name=PAGE_ACCESS_DENIED path=/app/campaign/promotion/mainPage.do/ /action This action does security first (we have a custom system that does role based security down to the action level). If the user does not have access it send them up the chain one step. They continue up the chain till they hit a point where they do have access. This way we get them to ass deep as they can go (get your mind out of the gutter). Anway.. The chains work by defining a PROPERTY_NAME that relates to an any element in a form. In this case, submit buttons. If the user clicked Do Delete it sends them to introSaveMessageAdd and then to deleteBitmap, and then to the introAddPage. This way my actions a very modular. You can also do a DECHAIN which will run through the actions like normal but the last one is treated as a seperate request and gets a new form and request object (good for going from one form to another and not having bean issues). It also does other things like you can defined a message to put into the session at the end of the chain, etc... Anyway.. I can see if I can release the code if you want. - Original Message - From: julian green [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 11:04 AM Subject: Re: How do you keep your session junk free? It would be neat if you could group a bunch of action definitions together and have the form bean persist while the group remianed active. Julian David Graham wrote: Explain how some other approach handles it in any better way? Use of token to prevent duplicate submissions works for me. And what do you mean by a continuation-style programming? The token approach is an easy solution. One of the sites listed was a Smalltalk web framework. It's good to look at things in different ways but you could probably count the number of Smalltalk web applications on one hand :-). David _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - 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: How do you keep your session junk free?
#. For example: createEmployee_1, createEmployee_2, etc. We would use the same rules as above, except we would always create a new wizard bag in step one of the wizard (and drop the current one even if it already exists). We would also verify that the wizard bag with our current wizard's logical name already exists in subsequent steps, and if it doesn't, forward to an exception page (because this means we either lost the wizard bag in the middle of the process due to another client browser's request (in the same session), or we jumped into the middle of the wizard somehow - see #2 above). Having the step number may be useful for other purposes as well. --joe -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:33 AM To: Struts Users Mailing List Subject: Re: How do you keep your session junk free? I kinda have a class that does that if you want. I have an Action called ChainAction that can call N number of actions in a row and passes the same form and request info through all the actions. The last action in the chain is then used to do a foward to whatever. This is how I control all application flow via the struts-config file. Example: action path=/app/campaign/promotion/type/pantryLoading/introAddChain className=com.symbol.mobilecommerce.analysis.struts.ChainActi onMapping type=com.symbol.mobilecommerce.analysis.struts.ChainAction name=pantryLoadingIntro set-property property=ROLE value=admin/ set-property property=PROPERTY_NAME value=action/ set-property property=CHAIN value=Do Delete : /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/deleteBitmapAdd, /app/campaign/promotion/type/pantryLoading/introAddPage/ set-property property=CHAIN value=Add Bitmap : /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/addBitmapAdd, /app/campaign/promotion/type/pantryLoading/introEditPage/ set-property property=CHAIN value=Next: /app/campaign/promotion/type/pantryLoading/introSaveMessageAdd, /app/campaign/promotion/type/pantryLoading/messageTypeAddChain/ forward name=PAGE_CHAIN_ERROR path=/app/campaign/promotion/type/pantryLoading/introAddPage.do/ forward name=PAGE_ACCESS_DENIED path=/app/campaign/promotion/mainPage.do/ /action This action does security first (we have a custom system that does role based security down to the action level). If the user does not have access it send them up the chain one step. They continue up the chain till they hit a point where they do have access. This way we get them to ass deep as they can go (get your mind out of the gutter). Anway.. The chains work by defining a PROPERTY_NAME that relates to an any element in a form. In this case, submit buttons. If the user clicked Do Delete it sends them to introSaveMessageAdd and then to deleteBitmap, and then to the introAddPage. This way my actions a very modular. You can also do a DECHAIN which will run through the actions like normal but the last one is treated as a seperate request and gets a new form and request object (good for going from one form to another and not having bean issues). It also does other things like you can defined a message to put into the session at the end of the chain, etc... Anyway.. I can see if I can release the code if you want. - Original Message - From: julian green [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, March 07, 2003 11:04 AM Subject: Re: How do you keep your session junk free? It would be neat if you could group a bunch of action definitions together and have the form bean persist while the group remianed active. Julian David Graham wrote: Explain how some other approach handles it in any better way? Use of token to prevent duplicate submissions works for me. And what do you mean by a continuation-style programming? The token approach is an easy solution. One of the sites listed was a Smalltalk web framework. It's good to look at things in different ways but you could probably count the number of Smalltalk web applications on one hand :-). David _ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail - 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
Re: Proper way to Link
You can do action chaining such as with the Struts Chaining project. I wrote my own version it isn't that hard... - Original Message - From: Chen, Gin [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Tuesday, March 04, 2003 10:39 AM Subject: Proper way to Link Hi all, I have two action classes that used to handle separate forms that I want to merge into one. Rather than delete one of the action classes I will just have the mappings for it go from the previous file to it. So I have dummy handlers in the first file that does a return new ActionForward(/blah.do); to get to the second action. Just out of curiousity. Is this the proper way to link actions? Is there a better way? I'm sure alot of people do this just to break up larger actions to make it more managable but I can't find any references for this on the Struts site and via Google (Linking Struts Actions) Thanks. -Tim - 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]
What does this erroe mean
I keep getting: no input attribute found for path ... Everything looks good in my config files... what causes this error? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What does this erroe mean
But what is an input attribute? I've got a form with tons of input fields as well as a form-bean specified and an action for the path specified. Everything looks fine.. that is why I can't figure out what is wrong. What type of mis-configuraiton usually causes this issue? -- Sloan - Original Message - From: James Mitchell [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, March 03, 2003 9:29 AM Subject: RE: What does this erroe mean It means you did not specify an input attribute for the action with path '...' -- James Mitchell Web Developer/Struts Evangelist http://jakarta.apache.org/struts/ People demand freedom of speech to make up for the freedom of thought which they avoid. - Soren Aabye Kierkegaard (1813-1855) -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 9:27 AM To: Struts Users Mailing List Subject: What does this erroe mean I keep getting: no input attribute found for path ... Everything looks good in my config files... what causes this error? - 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: What does this erroe mean
From further debugging I found that if I use pantryLoadingIntroChai as the name of my form-bean and also as the attribute name in my action tag it works fine. If I use: pantryLoadingIntroChain it does not work. The name is somehow clashing with another defined name of the same type somewhere but I can't find it anywhere else...(that is my theory at least) I'm just going to use a different name for now... Thanks for the help -- Sloan - Original Message - From: Jarnot Voytek Contr AU HQ/SC [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, March 03, 2003 9:25 AM Subject: RE: What does this erroe mean we'll need to see at least the relevant part of your struts-config.xml. Also, what's throwing the error? -- Voytek Jarnot Quidquid latine dictum sit, altum viditur. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Monday, March 03, 2003 8:27 AM To: Struts Users Mailing List Subject: What does this erroe mean I keep getting: no input attribute found for path ... Everything looks good in my config files... what causes this error? - 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: c:out
Good guess... it worked ;) Thanks! -- Sloan - Original Message - From: Joseph Fifield [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 1:52 PM Subject: Re: c:out This is just a guess...did you try: sessionScope['com.symbol.mobilecommerce.analysis.SESSION_USER'].lastName Joe - Original Message - From: Sloan Seaman [EMAIL PROTECTED] To: Tag Libraries Users List [EMAIL PROTECTED] Cc: Struts Users Mailing List [EMAIL PROTECTED] Sent: Sunday, March 02, 2003 1:39 PM Subject: c:out I have a variable in the session named: com.symbol.mobilecommerce.analysis.SESSION_USER I want to get the object via c:out and use it in a JSP page. When I have the variable just named SESSION_USER it works fine. Example (note core:out = c:out) Greetings core:out value=${sessionScope.SESSION_USER.firstName}/ core:out value=${sessionScope.SESSION_USER.lastName}/. But if I try: Greetings core:out value=${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN ame}/ core:out value=${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa me}/. It doesn't work. I know this is because c:out is trying to call the object com and then the getter symbol and so on. How do I get around this so that it works? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Multiple forms and javascript
I think this was discuess eariler but I can't seem to find the answer I need. Anyway... I have two forms on one .jsp page and I wish to use javascript validation for both of them. The problem is that if I have two tags list so: html:javascript formName=pantryLoadingAddBitmap/ html:javascript formName=pantryLoadingDeleteBitmap/ It birngs in multiple copies of the same javascript functions and I thinkt hat is causing a javascript error I am getting (besides the fact that it is bloating the page). How do I get around this? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
c:out
I have a variable in the session named: com.symbol.mobilecommerce.analysis.SESSION_USER I want to get the object via c:out and use it in a JSP page. When I have the variable just named SESSION_USER it works fine. Example (note core:out = c:out) Greetings core:out value=${sessionScope.SESSION_USER.firstName}/ core:out value=${sessionScope.SESSION_USER.lastName}/. But if I try: Greetings core:out value=${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.firstN ame}/ core:out value=${sessionScope.com.symbol.mobilecommerce.analysis.SESSION_USER.lastNa me}/. It doesn't work. I know this is because c:out is trying to call the object com and then the getter symbol and so on. How do I get around this so that it works? Thanks! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:messages causing NullPointerException
I have an interesting situation. I've got an action chainer thing I wrote that works fine until one of the actions jsp pages tried to have something like: html:messages id=retireMessage property=success message=true core:out value=${retireMessage}/ /html:messages All of the action is the chain work fine but for some reason the last action in the chain (the one whose ActionForward I actually pay attention to) if it has the above code, throws the following error: - Root Cause - java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:389) at org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java: 234) at org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:250) at org.apache.jsp.main_jsp._jspService(main_jsp.java:268) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) etc... The message tag works fine otherwise Idea's? Thanks.. -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
DynaValidatorActionForm
I'm getting the hang of struts (very cool) but I'm not sure how I should be doing the following. I have your standard add/change/delete part of an application. For the add part I have the following form bean defined: form-bean name=appCampaignAdd type=org.apache.struts.validator.DynaValidatorForm form-property name=name type=java.lang.String/ form-property name=description type=java.lang.String/ form-property name=startDateMonth type=java.lang.String/ form-property name=startDateDayOfMonth type=java.lang.String/ form-property name=startDateYear type=java.lang.String/ form-property name=endDateMonth type=java.lang.String/ form-property name=endDateDayOfMonth type=java.lang.String/ form-property name=endDateYear type=java.lang.String/ form-property name=action type=java.lang.String/ /form-bean Here is my question: For my edit page, how do I populate a bean for the edit page to use to populate the fields? From what I've been reading it seems like I don't ahve to write a form class anymore because of the DynaActionForm stuff, but I'm a bit confused. So far all I ahve figured out is that to get to the edit page I will call and action that will somehow populate something and then the jsp page will be displayed and will be populated... Help? -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javasript and checkboxes
Is there an easy way in Struts to check if a checkbox has been checked via javascript before you let the user submit? I am using Struts javascript for other validation, but I don't' see anything for checkboxes... I know how to hand code this but I am wondering if Struts has this covered... Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Javascript displayed on page
What woudl cause Struts to put Javascript into a page but NOT put script type=text/javascript language=Javascript1.1 !-- Begin and //End -- /script It seems to be leaving it out for me on a certain page. On other pages it works fine though. Also, is there any way to get strust to send only the javascript methods it needs? Right now it sends a lot of methods that are not needed for my forms. Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Call to other actions
Is there anyway in an Action class to call another action and get whatever action forwarder it returned? To be more specific: I want to define a action chain that will go through the various defined actions ignoring the ActionForward that they return until I get to the last one. Basically I have a parameter passed to a class that extends Action like so: set-property property=Action value=Promo Mgmt : /app/campaign/add.do, /app/campaign/promo/main.do/ and I want the class to call add.do and let it do its thing (without doing whaterever it says to forward to) and then call main.do and let it do its thing and use the returned forwarder. I am doing this because I have a lot of forms tht have mutlipe submit buttons and depending on the button pressed I want to do various sets of actions. In the example above the button value is Promo Mgmt and the chain of events is everything after the : -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Nested tags
How do I pull this off? html:messages id=retireMessage property=success message=true tiles:insert page=/app/global/messages/success.jsp tiles:put name=message value=%= retireMessage %/ /tiles:insert /html:messages I'm guessing I have to do something with nested tags but I'm not sure what. Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Passing parameters to Actions
In the struts-config.xml file I want to pass a few parameters to my actions but it looks like the DTD only supports one parameter tag. I.E.: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main parameter=admin forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ /action When I would rather do something like: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ parameter name=ROLES_ALLOWED value=admin/ /action Now, I know there is a roles attribute but we are doing out own security model and are not using request.isUserInRole(). (BTW: is there any way to write to whatever request.isUserInRole() used to do its lookup so we can use it?) Is there any way to have parameters passed like how I would like? I could spoof forward to something like forward name=ROLES_ALLOWED path=admin/ but I would rather not. Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing parameters to Actions
Ok. sounds like a plan. Question though: How do I access the set-property information? Do I have to parse the XML or something? Sorry... I'm a bit new to Struts... -- Sloan - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 2:40 PM Subject: RE: Passing parameters to Actions Here is a config sample: action path=/myAction.do parameter=submit type=com.foo.MyAction name=myForm scope=request className=com.foo.MyExtendedActionMapping set-property property=xxx value=yyy/ forward name=success path=here.jsp redirect=false/ forward name=fail path=there.jsp redirect=true/ /action Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 12:33 PM To: Struts Users Mailing List Subject: RE: Passing parameters to Actions parameter is only used for dispatch actions. If you want to set properties for an action... you can extend the ActionMapping class and use the set-property in an action element while specifying the className attribute of the action element. Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 12:29 PM To: Struts Users Mailing List Subject: Passing parameters to Actions In the struts-config.xml file I want to pass a few parameters to my actions but it looks like the DTD only supports one parameter tag. I.E.: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main parameter=admin forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ /action When I would rather do something like: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ parameter name=ROLES_ALLOWED value=admin/ /action Now, I know there is a roles attribute but we are doing out own security model and are not using request.isUserInRole(). (BTW: is there any way to write to whatever request.isUserInRole() used to do its lookup so we can use it?) Is there any way to have parameters passed like how I would like? I could spoof forward to something like forward name=ROLES_ALLOWED path=admin/ but I would rather not. Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing parameters to Actions
Very cool. Thanks!!! -- Sloan - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 3:06 PM Subject: RE: Passing parameters to Actions It is done automagically upon startup of your application. When struts processes it's config (struts-config.xml) it generates ActionMapping instances for each action. When you specify your extended ActionMapping in the className attribute of action struts will populate the related property or properties of that class. Your extended Action mapping must have matching getter/setter properties that match you property= value (i.e. set-property property=aProperty value=aValue/ relates to public setAProperty(String aValue){};) One of the issues you might run into is that you cant easily change the properties during runtime. If you make role changes to the Action you will have to reboot the webapp. This is usually not a major deal. Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 12:56 PM To: Struts Users Mailing List Subject: Re: Passing parameters to Actions Ok. sounds like a plan. Question though: How do I access the set-property information? Do I have to parse the XML or something? Sorry... I'm a bit new to Struts... -- Sloan - Original Message - From: Brandon Goodin [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 2:40 PM Subject: RE: Passing parameters to Actions Here is a config sample: action path=/myAction.do parameter=submit type=com.foo.MyAction name=myForm scope=request className=com.foo.MyExtendedActionMapping set-property property=xxx value=yyy/ forward name=success path=here.jsp redirect=false/ forward name=fail path=there.jsp redirect=true/ /action Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Brandon Goodin [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 12:33 PM To: Struts Users Mailing List Subject: RE: Passing parameters to Actions parameter is only used for dispatch actions. If you want to set properties for an action... you can extend the ActionMapping class and use the set-property in an action element while specifying the className attribute of the action element. Brandon Goodin Phase Web and Multimedia PO Box 85 Whitefish MT 59937 P (406) 862-2245 F (406) 862-0354 [EMAIL PROTECTED] http://www.phase.ws -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED] Sent: Tuesday, February 25, 2003 12:29 PM To: Struts Users Mailing List Subject: Passing parameters to Actions In the struts-config.xml file I want to pass a few parameters to my actions but it looks like the DTD only supports one parameter tag. I.E.: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main parameter=admin forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ /action When I would rather do something like: action path=/app/main type=com.symbol.mobilecommerce.analysis.actions.app.Main name=app.main forward name=PAGE_SRC path=/app/main.jsp/ forward name=PAGE_ACCESS_DENIED path=/index.jsp/ parameter name=ROLES_ALLOWED value=admin/ /action Now, I know there is a roles attribute but we are doing out own security model and are not using request.isUserInRole(). (BTW: is there any way to write to whatever request.isUserInRole() used to do its lookup so we can use it?) Is there any way to have parameters passed like how I would like? I could spoof forward to something like forward name=ROLES_ALLOWED path=admin/ but I would rather not. Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED
Nested tags
I have the following in a jsp page: TDhtml:checkbox name=retire value=core:out value=${campaign.campaignId}///TD The page blows up with a jsp.error.unterminated.tag error. I'm guessing I have to use a nested tag to pull this off, but I don't know how. Could someone help me out. Here is the full block of code. The campaign:list tag is a custom tag that iterates and places the bean in the pageContext object. campaign:list id=campaign TR bgcolor=#CC TDcore:out value=${campaign.name}//TD TDhtml:link page=/app/campaign/promo/index.jspPromo Mgmt/html:link/TD TDhtml:checkbox name=retire value=core:out value=${campaign.campaignId}///TD /TR /campaign:list Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using the html:message tag
Thanks! Works like a charm! -- Sloan - Original Message - From: Larry Zappeterrini [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Friday, February 14, 2003 3:12 PM Subject: RE: Using the html:message tag html:messages works a bit differently than html:errors in that it does not print out the collection containing your messages for you. You must do it manually between a begin and end tag. Using your example, you would have to do the following: html:messages id=mdxquery property=success message=true %-- print out mdxquery, could also use bean:write --% c:out value=${mdxquery} / /html:messages -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:57 PM To: Struts Users Mailing List Subject: Re: Using the html:message tag Guys... Thanks for the info but it is still not working (I will work on it on Monday). Here is what I understand (becuase I'm feeling like an idiot right now). The property attribute looks like the right thing because the API docs for ActionMessages say the first parameter is for property. The message tag being set to true I also understand. The Id tag however... I don't know what to do (it is required). I have no Idea what to set it to. Here is (hopefully for the final time) my entire html and source code: HTML: %@ page language=java % %@ taglib uri=/WEB-INF/tags/struts/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/tags/struts/struts-tiles.tld prefix=tiles % html:html locale=true HEAD TITLEPOC - Admin - Query/TITLE html:base/ /HEAD BODY bgcolor=#FF tiles:insert page=/app/global/header/header.jsp/ P html:errors/ html:messages id=mdxquery property=success message=true/ Please enter your query: html:javascript formName=mdxQuery/ html:form action=/mdxQuery focus=description onsubmit=return validateMdxQuery(this); INPUT TYPE=HIDDEN name=FAILURE_PAGE value=/app/admin/query.jsp INPUT TYPE=HIDDEN name=SUCCESS_PAGE value/app/admin/query.jsp TABLE border=0 TR TD align=LEFT valign=CENTERDescription/TD /TR TR TD align=LEFT valign=CENTER html:text property=description size=50/ /TR /TR TR TD align=LEFT valign=CENTERQuery/TD /TR TR TD align=LEFT valign=CENTER html:textarea property=query cols=50 rows=5/ /TR /TR TR TD align=CENTER valign=CENTER html:submit value=Do Query/ /TR /TR /TABLE /html:form /BODY /html:html and here is the java: package com.symbol.mobilecommerce.analysis.actions; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.commons.beanutils.PropertyUtils; public final class MdxQuery extends Action { public ActionForward execute(ActionMapping _mapping, ActionForm _form, HttpServletRequest _request, HttpServletResponse _response) throws Exception { ActionErrors errors = new ActionErrors(); ActionMessages messages = new ActionMessages(); // Validate the request parameters specified by the user String description = (String) PropertyUtils.getSimpleProperty(_form, description); String query = (String) PropertyUtils.getSimpleProperty(_form, query); // Report any errors we have discovered back to the original form if (!errors.isEmpty()) { saveErrors(_request, errors); return new ActionForward( (String)PropertyUtils.getSimpleProperty(_form, FAILURE_PAGE) ); //return (_mapping.getInputForward()); } // Remove the obsolete form bean if (_mapping.getAttribute() != null) { if (request.equals(_mapping.getScope())) _request.removeAttribute(_mapping.getAttribute()); else _request.getSession().removeAttribute(_mapping.getAttribute()); } messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); // Forward control to the specified success URI return new ActionForward( (String)PropertyUtils.getSimpleProperty(_form, SUCCESS_PAGE) ); } } - Original Message - From: Sri Sankaran [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 2:25 PM Subject: RE: Using the html:message tag Use the property attribute. html:messages property=success message=true/ Also take a look at the html-messages.jsp file that is part of the struts-exercise-taglib application that ships with Struts. Sri -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:09 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Using the html:message tag Jerome, I tried it but it didn't work. Here is what I have in my HTML: html:messages id=success message=true / And here is what is in my action file: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); where mxdquery.success in a value
Keep getting bean error
I was wondering if anyone could help me. I keep getting the error: org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope when I try to access a .jsp page. Any help would be great! (I'm new to struts) Thanks! -- Sloan Here is the source of the page: %@ page language=java % %@ taglib uri=/WEB-INF/tags/struts/struts-html.tld prefix=html % html:html locale=true HEAD TITLEPOC - Admin - Query/TITLE html:base/ /HEAD BODY bgcolor=#FF html:errors/ Please enter your query: html:form action=/mdxQuery focus=description/ html:hidden property=action/ html:hidden property=success value=query.jsp/ html:hidden property=failure value=query.jsp/ TABLE border=0 TR TD align=LEFT valign=CENTERDescription/TD /TR TR TD align=LEFT valign=CENTER html:text property=description size=50/ /TR /TR TR TD align=LEFT valign=CENTERQuery/TD /TR TR TD align=LEFT valign=CENTER html:textarea property=query cols=50 rows=5/ /TR /TR TR TD align=CENTER valign=CENTER html:submit value=Do Query/ /TR /TR /TABLE /html:form /BODY /html:html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Keep getting bean error
I figured it out. If you look at my HTML you will see that I accidentally had the initial html:form tag ending on the same line I started it on. Thanks for the quick responses though! -- Sloan - Original Message - From: Sri Sankaran [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 12:52 PM Subject: RE: Keep getting bean error What does your action mapping with path /mdxQuery look like? Sri -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 12:42 PM To: [EMAIL PROTECTED] Subject: Keep getting bean error I was wondering if anyone could help me. I keep getting the error: org.apache.jasper.JasperException: Cannot find bean org.apache.struts.taglib.html.BEAN in any scope when I try to access a .jsp page. Any help would be great! (I'm new to struts) Thanks! -- Sloan Here is the source of the page: %@ page language=java % %@ taglib uri=/WEB-INF/tags/struts/struts-html.tld prefix=html % html:html locale=true HEAD TITLEPOC - Admin - Query/TITLE html:base/ /HEAD BODY bgcolor=#FF html:errors/ Please enter your query: html:form action=/mdxQuery focus=description/ html:hidden property=action/ html:hidden property=success value=query.jsp/ html:hidden property=failure value=query.jsp/ TABLE border=0 TR TD align=LEFT valign=CENTERDescription/TD /TR TR TD align=LEFT valign=CENTER html:text property=description size=50/ /TR /TR TR TD align=LEFT valign=CENTERQuery/TD /TR TR TD align=LEFT valign=CENTER html:textarea property=query cols=50 rows=5/ /TR /TR TR TD align=CENTER valign=CENTER html:submit value=Do Query/ /TR /TR /TABLE /html:form /BODY /html:html - 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]
Using the html:message tag
I want to display messages in my html when the action completes successfully (think Query successfully processed type messages.) I'm guessing I use the html:messages tag but it doesn't seem to be working. In my code I have: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); And in my html I have: html:messages id=success/ What am I doing wrong? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using the html:message tag
Jerome, I tried it but it didn't work. Here is what I have in my HTML: html:messages id=success message=true / And here is what is in my action file: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); where mxdquery.success in a value in my ApplicationResources.properties file.. I'm not sure about the id attribute. The API for ActionMessages.add says the first string is the property while the docs on the id attribute say it is the name scope of the JSP bean(??)... Idea's? -- Sloan - Original Message - From: Jerome Jacobsen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 1:47 PM Subject: RE: Using the html:message tag Try this: html:messages id=success message=true / If you omit message=true then the tag only looks for error messages under Action.ERROR_KEY. With the message=true it will look for messages under Action.MESSAGE_KEY. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:26 PM To: Struts Users Mailing List Subject: Using the html:message tag I want to display messages in my html when the action completes successfully (think Query successfully processed type messages.) I'm guessing I use the html:messages tag but it doesn't seem to be working. In my code I have: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); And in my html I have: html:messages id=success/ What am I doing wrong? Thanks! -- Sloan - 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: Using the html:message tag
Jerome, It still didn't work. Here is what I have (you left out the id tag which is required so I tried two seperate things) html:messages id=mdxquery name=success message=true / and html:messages id=success name=success message=true / Still nothing... Any other ideas? Thanks! -- Sloan - Original Message - From: Jerome Jacobsen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 2:13 PM Subject: RE: Using the html:message tag Sorry. It should be this: html:messages name=success/ -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:09 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Using the html:message tag Jerome, I tried it but it didn't work. Here is what I have in my HTML: html:messages id=success message=true / And here is what is in my action file: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); where mxdquery.success in a value in my ApplicationResources.properties file.. I'm not sure about the id attribute. The API for ActionMessages.add says the first string is the property while the docs on the id attribute say it is the name scope of the JSP bean(??)... Idea's? -- Sloan - Original Message - From: Jerome Jacobsen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 1:47 PM Subject: RE: Using the html:message tag Try this: html:messages id=success message=true / If you omit message=true then the tag only looks for error messages under Action.ERROR_KEY. With the message=true it will look for messages under Action.MESSAGE_KEY. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:26 PM To: Struts Users Mailing List Subject: Using the html:message tag I want to display messages in my html when the action completes successfully (think Query successfully processed type messages.) I'm guessing I use the html:messages tag but it doesn't seem to be working. In my code I have: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); And in my html I have: html:messages id=success/ What am I doing wrong? Thanks! -- Sloan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using the html:message tag
Guys... Thanks for the info but it is still not working (I will work on it on Monday). Here is what I understand (becuase I'm feeling like an idiot right now). The property attribute looks like the right thing because the API docs for ActionMessages say the first parameter is for property. The message tag being set to true I also understand. The Id tag however... I don't know what to do (it is required). I have no Idea what to set it to. Here is (hopefully for the final time) my entire html and source code: HTML: %@ page language=java % %@ taglib uri=/WEB-INF/tags/struts/struts-html.tld prefix=html % %@ taglib uri=/WEB-INF/tags/struts/struts-tiles.tld prefix=tiles % html:html locale=true HEAD TITLEPOC - Admin - Query/TITLE html:base/ /HEAD BODY bgcolor=#FF tiles:insert page=/app/global/header/header.jsp/ P html:errors/ html:messages id=mdxquery property=success message=true/ Please enter your query: html:javascript formName=mdxQuery/ html:form action=/mdxQuery focus=description onsubmit=return validateMdxQuery(this); INPUT TYPE=HIDDEN name=FAILURE_PAGE value=/app/admin/query.jsp INPUT TYPE=HIDDEN name=SUCCESS_PAGE value/app/admin/query.jsp TABLE border=0 TR TD align=LEFT valign=CENTERDescription/TD /TR TR TD align=LEFT valign=CENTER html:text property=description size=50/ /TR /TR TR TD align=LEFT valign=CENTERQuery/TD /TR TR TD align=LEFT valign=CENTER html:textarea property=query cols=50 rows=5/ /TR /TR TR TD align=CENTER valign=CENTER html:submit value=Do Query/ /TR /TR /TABLE /html:form /BODY /html:html and here is the java: package com.symbol.mobilecommerce.analysis.actions; import javax.servlet.http.*; import org.apache.struts.action.*; import org.apache.commons.beanutils.PropertyUtils; public final class MdxQuery extends Action { public ActionForward execute(ActionMapping _mapping, ActionForm _form, HttpServletRequest _request, HttpServletResponse _response) throws Exception { ActionErrors errors = new ActionErrors(); ActionMessages messages = new ActionMessages(); // Validate the request parameters specified by the user String description = (String) PropertyUtils.getSimpleProperty(_form, description); String query = (String) PropertyUtils.getSimpleProperty(_form, query); // Report any errors we have discovered back to the original form if (!errors.isEmpty()) { saveErrors(_request, errors); return new ActionForward( (String)PropertyUtils.getSimpleProperty(_form, FAILURE_PAGE) ); //return (_mapping.getInputForward()); } // Remove the obsolete form bean if (_mapping.getAttribute() != null) { if (request.equals(_mapping.getScope())) _request.removeAttribute(_mapping.getAttribute()); else _request.getSession().removeAttribute(_mapping.getAttribute()); } messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); // Forward control to the specified success URI return new ActionForward( (String)PropertyUtils.getSimpleProperty(_form, SUCCESS_PAGE) ); } } - Original Message - From: Sri Sankaran [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 2:25 PM Subject: RE: Using the html:message tag Use the property attribute. html:messages property=success message=true/ Also take a look at the html-messages.jsp file that is part of the struts-exercise-taglib application that ships with Struts. Sri -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:09 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Using the html:message tag Jerome, I tried it but it didn't work. Here is what I have in my HTML: html:messages id=success message=true / And here is what is in my action file: ActionMessages messages = new ActionMessages(); messages.add(success, new ActionMessage(mdxquery.success)); saveMessages(_request, messages); where mxdquery.success in a value in my ApplicationResources.properties file.. I'm not sure about the id attribute. The API for ActionMessages.add says the first string is the property while the docs on the id attribute say it is the name scope of the JSP bean(??)... Idea's? -- Sloan - Original Message - From: Jerome Jacobsen [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Friday, February 14, 2003 1:47 PM Subject: RE: Using the html:message tag Try this: html:messages id=success message=true / If you omit message=true then the tag only looks for error messages under Action.ERROR_KEY. With the message=true it will look for messages under Action.MESSAGE_KEY. -Original Message- From: Sloan Seaman [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 1:26 PM To: Struts Users Mailing List Subject: Using the html:message tag I want to display messages in my html when the action completes successfully (think