Re: redirectig to WORD files
For the word document to automatically open in the browser you should do this on the client side : - double click on My Computer - Tools menu -Folder Options - File Types - Search for the DOC extension and then click on Advanced. Uncheck : Confirm open after download. Ovidiu On Wed, 26 Jan 2005 14:04:34 -0500, Erik Weber [EMAIL PROTECTED] wrote: Jim Barrows wrote: On Wed, 26 Jan 2005 16:24:21 +0100, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all I try to redirect my response to a word doc file.But after setting contexttype and using response.sendRedirect(docWordURL) , I get white page; What I want is open this word document on a click of a link in a normal jsp.I call the action that has to redirecting me to that file. Any idea? Turning on the file serving servlet might be a good idea it's container specific on how to do that. Is that an easier way to accomplish the same thing as manually serving the binary content from an Action? I've never used it before. Erik Regards 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Advise How to set alternative raow background color
Personnaly for this kind of stuff i've got my own tag that have the hability to iterate and to cycle over given values. - Original Message - From: Kishore Senji [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 27, 2005 8:26 AM Subject: Re: Advise How to set alternative raow background color On Thu, 27 Jan 2005 12:49:00 +0530, senthil Kumar [EMAIL PROTECTED] wrote: Hi all. I am getting more than 100 regards from database and print in a JSP by 15 regards per Page. Its is working fine. Now i want to set alternative Row background color. I print all the rows between the logic:iterator in Struts. any one help me. Here i am putting my code also. welcome anyone to give correct code also, logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList tr bgcolor=#c2c2c2 logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList indexId=index tr bgcolor='%=index.intValue()%2==0?#c2c2c2:#d2d2d2%' td align=left a href=ShowThread.do?messageId=bean:write name=collection property=messageId/ bean:write name=collection property=topic/ /a /td td align=center bean:write name=DFThreadForm property=projectName/ /td td align=centerbean:write name=collection property=enteredDate//td /tr /logic:iterate Thanks in Advance Regs., senthil - 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 Security
Hi, I've never used EJB so have no idea what this means, can someone explain please? When SecurityFilter is used, a user's Principal will not automatically be propagated to EJB calls. If this is a requirement for your application, you may not be able to use SecurityFilter. Also, (as above) I'm using JDBCRealm to authenticate clients. I then have a tile which contains all the menu settings; I use the present roles to check for which features should be loaded How easy would it be to implement this using the SecurityFilter - does anyone know of a good tutorial? Cheers, Tim On Thu, 27 Jan 2005 08:25:14 +0100, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Take a look at SecurityFilter - http://securityfilter.sourceforge.net/ Works like a charm with Tomcat and JDBC realms. Then you do REAL declarative security - No coding needed. Hermod -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 6:31 AM To: user@struts.apache.org Subject: RE: Struts Security I think the logic:present tag will allow access to any of the roles mentioned. Mohan -Original Message- From: Tim Christopher [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:41 AM To: Struts Users Mailing List Subject: Re: Struts Security Just a quick question... What is gained by using code like this: String[] roles = mapping.getRoleNames(); if(roles == null || roles.length == 0) return true for(int i=0; iroles.length; i++) { if(request.isUserInRole(roles[i])) { return true; } } return false; ...isn't that the same as logic:present role=roleA, roleB, roleG? Or is that a check for all roles: roleA, roleB, and roleG? Tim On Wed, 26 Jan 2005 20:27:22 -0700, Nic Holbrook [EMAIL PROTECTED] wrote: I forgot to mention the reason I did this was because we already had a security mechanism in place and didn't have the liberty of using realms on the web or anything like that. It had to be a custom configuration. Nic Holbrook wrote: I kind of set our security up before the struts menu was in place. What I have done that seems to work well so far is extend the Action class with a SecureAction class that validates the users role before it lets the user into an action. The execute method actually validates and calls an abstract secureExecute (which is now the main struts method) if the user is in the role. I set a roleId in the struts-config.xml for each action which really isn't a big deal (set-property property=actionRole value=700/). That way the role is set up 1 time for each action. You can use the same role for several actions of you like. When the user logs in, I retrieve all the roles allowed for that user and store it in a UserContext object in the session. I then have a menu tag that dynamically builds the menu for them which isn't that difficult to set up. I use it in a tile so I only insert it 1 time. Just some ideas. Craig McClanahan wrote: On Sun, 23 Jan 2005 18:39:50 +, Tim Christopher [EMAIL PROTECTED] wrote: Hi, I am designing a web application using Struts, which will run using Tomcat. The system will have upwards of 1000 users, with each user having any number of around 10 possible roles. I'm currently thinking of using JDBCRealm within the Tomcat xml file to set the roles for each of the users, then extending the RequestProcessor to ensure only authorised users can enter the secure area. I then have a number of menu options that should only be made visible to users with certain roles; I intend to use logic:present role=.. or req:isUserInRole role=... to do this - from what I can see they are functionally identical(?). The implementation of logic:present role= uses request.isUserInRole() under the covers :-). I guess what I'd like to know is: * Will this approach actually work? Yep. * Is there a better way? This sounds best for your use case. * Will any changes to user roles made within the database automatically update the roles that tomcat uses from the JDBCRealm, or will it require a server restart? Tomcat's JDBCRealm caches the relevant roles for a user when he or she logs on, so they won't change for the length of that session ... but changes will get reflected next time the same person logs on. * Also if I use a check within the jsp like logic:present role=.. to decide if a component should be dispalyed, I have read it is also advisable to require to presence of a role to use the Action. This method will require two updates to allow an additional an additional role to access a resource (update in the jsp, and in the xml file) - is there a way around this? You can
Can you stretch a form over several tabs with tile tabs layout?
The only problem I see is that the form needs to be submitted when clicking on another tab? Otherwise you loose the just entered data. Regards, Nils P.S. Is there a dedicated tiles mailing list?
Can you stretch a form over several tabs with tile tabs layout?
The only problem I see is that the form needs to be submitted when clicking on another tab? Otherwise you loose the just entered data. Regards, Nils P.S. Is there a dedicated tiles mailing list?
RE: html taglib usage
Great! Thanks for the help. John -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 4:07 PM To: Struts Users Mailing List Subject: RE: html taglib usage John, The name= attribute works with many of the text fields. Forget using html:form, just type those in the old fashion tag way. Then, for most of your tags, at the name=... attribute so the bean by that name will be obtained from scope (should check request then session automatically) and pull the property you listed. The docs show it should work on 1.2.4+ for html:select, html:options, and html:optionsCollection but NOT html:button. See the Struts site's User Guide for the HTML Tags, http://struts.apache.org/userGuide/dev_html.html, section HTML Taglib API Reference. Various fields show a name=.. attribute for using other beans, which should include POJOs since it just needs the bean name and a property to retrieve. I've used it for form beans saved in Session scope from inside other forms and from OUTSIDE a form. I think it will work with POJO's since there should be no struts-specific calls, just that name.property lookup. Regards, David -Original Message- From: Thorhauer, John (Contractor) [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 4:02 PM To: 'Struts Users Mailing List' Subject: RE: html taglib usage Yes. I am trying to use the html taglib. Here is a sample of what I am trying to do. The form is stored in the session with a name of PreferencesForm: --- html:form name=PreferencesForm type=com.tool.manager.DCMTPreferencesForm method=Post action=ActionPage.jsp html:select property=selectedColumns multiple=true size=5 html:options name=selectedColumns/ /html:select br/ html:button property=ProcessNewParameters value=Set New Parameters/ /html:form -- So it sounds like you are saying that this _should_ work? NOTE: I am not extending the ActionForm bean. It is just a POJO bean. Thanks, John -Original Message- From: David G. Friedman [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 3:51 PM To: Struts Users Mailing List Subject: RE: html taglib usage John, Which tags are you using? Have you added the name=... attribute so it can lookup a bean in any scope by that name instead of trying to use an ActionForm bean? Regards, David -Original Message- From: Thorhauer, John (Contractor) [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 3:02 PM To: 'user@struts.apache.org' Subject: html taglib usage Hi, Is it possible to use the struts html taglib from version 1.1 without using Struts? I would like to use it in conjunction with my own beans that I am using but can not use all of struts at this point. So I would like to simply put a bean into the session and then make it available to the form and use the struts html taglib to match the bean values to the form. However, when I try this I get the following error on my JSP page: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection Any ideas if this is possible and if so what I am doing wrong? Thanks, John - 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: html taglib usage
Yes. You are right. However, JSTL is not currently an option. Hopefully in the near future it will be. Thanks, John -Original Message- From: Karr, David [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 7:23 PM To: Struts Users Mailing List Subject: RE: html taglib usage I don't think it's practical to do that. You would probably be better off just using the raw HTML elements, but using the JSTL to reference your bean values (and even the EL directly, if you have a JSP 2.0 container). -Original Message- From: Thorhauer, John (Contractor) Hi, Is it possible to use the struts html taglib from version 1.1 without using Struts? I would like to use it in conjunction with my own beans that I am using but can not use all of struts at this point. So I would like to simply put a bean into the session and then make it available to the form and use the struts html taglib to match the bean values to the form. However, when I try this I get the following error on my JSP page: javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection Any ideas if this is possible and if so what I am doing wrong? Thanks, John - 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]
Process tiles definition from a different module
Hi! I need to process a tiles definition that is located in a different module. I have this ActionForward declared on the module I want to invoke: forward name=myPage path=.myTilesDefinition redirect=false/ And on the main module, I have this code (in an action) to get that forward definition. ActionForward forward = null; ServletContext context = getServlet().getServletContext(); ModuleConfig config = ModuleUtils.getInstance().getModuleConfig(othermodule, context); if (config != null org.apache.struts.action.ActionForward.equals(config.getActionForwardClass())) { forward = (ActionForward)config.findForwardConfig(myPage); } return forward; This doesn't work because Tiles is not processing the definition .myTilesDefinition (I have two separate Tiles definition configurations, one for each module). How can I get the definition on the other module processed by Tiles? I know I can import the definitions of the second module using set-property property=definitions-config ... in struts-config.xml, but I'm wondering if it's possible to do what I want without this trick. With TilesUtilStrutsModulesImpl class I get the DefinitionsFactory object for the second module, but I can't get past there. Thanks in advance. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat in Virtual hosting environment
Deepak, Note: What a nice question. Suggestion: Go to the Tomcat-users list where this is more pertinent. I'm not seeing any obvious Struts problem here with which we can assist you. Regards, David (who uses Tomcat/Stuts/Apache but likes list purity except for OT Fridays) -Original Message- From: Kumar deepak [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 1:06 AM To: user@struts.apache.org Subject: Tomcat in Virtual hosting environment How to intall tomcat in virtual hosting environment. Regards Deepak Kumar __ Do you Yahoo!? Take Yahoo! Mail with you! Get it on your mobile phone. http://mobile.yahoo.com/maildemo - 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: Advise How to set alternative raow background color
Kishore Senji wrote: On Thu, 27 Jan 2005 12:49:00 +0530, senthil Kumar [EMAIL PROTECTED] wrote: Hi all. I am getting more than 100 regards from database and print in a JSP by 15 regards per Page. Its is working fine. Now i want to set alternative Row background color. I print all the rows between the logic:iterator in Struts. any one help me. Here i am putting my code also. welcome anyone to give correct code also, logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList tr bgcolor=#c2c2c2 logic:iterate id=collection name=DFThreadForm scope=session property=selectRegsList indexId=index tr bgcolor='%=index.intValue()%2==0?#c2c2c2:#d2d2d2%' Instead of setting bgcolor, set the class attribute: class='%= index.intValue()%2 == 0 ? event : odd% That way, you can use CSS to change the color easily on all of your pages at once. tr.even { background-color: #C2C2C2; } tr.odd { background-color: #D2D2D2; } -- Jeff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PlugIn and the base URL
Craig, I knew I should have put that tidbit in my email - it was in my first revision. I took it out because it sounded too preachy in my first draft. I agree with you since the product I'm working on has every virtualhost mapped to one Tomcat context for application sharing. As we've read, Martin seems to be assuming the opposite (exactly one context for his customer) and has his mind 100% stuck on MAGIC setup the very first time. Personally, I do not see anything wrong with waiting for the first SOAP or HTTP call to perform the setup steps. Even if that first call takes 20-30 seconds (read: outch!), further calls will be instant. If you save that URL somewhere (file, DB, etc.), the plugIn can know that information and upon further webapp restarts perform initialization instantly so no further wait occurs. If Martin is 100% sure of his future clients' setup(s), my suggestion could work. Heck, he could even make those conditions a requirement for deployment: port 80 and a specific context on both the web server and java app server. That doesn't seem like much of an issue for selling something. Regards, David -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 1:06 AM To: Struts Users Mailing List Subject: Re: PlugIn and the base URL On Wed, 26 Jan 2005 13:32:50 -0500, David G. Friedman [EMAIL PROTECTED] wrote: A Devil's Advocate says: I agree with the theory that the webapp Context name within the application server /myapp should be available to the servlet but not the host/port/etc. The assumption that a particular webapp only has one context path -- or even one host:port combination -- is not in conformance with reality on most modern servers. Consider, for example, how many environments are set up such that www.mycompany.com and company.com resolve to the same webapp. The same sort of aliasing of the context path is trivially simple in any modern web server or app server. Application architectures based on the assumption that there is one-and-only-one URL for the app should be rethought. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PlugIn and the base URL
The light came on when the ip address is sufficient came up. I had context paths and ports in my head. If that's all you need, look at the INetAddress classes which have methods to get a host name and ip address for the localhost. Regards...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 11:51 PM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL Thanks to everybody who contributed to this topic. There appears to be no foolproof solution to the particular problem that I have. I think I will have to go with an external installer/config program. Thanks again to everybody. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Anyway, if an IP address is sufficient, and why wouldn't it be (?), then all you have to do is to provide a servlet to tell all machines that ask their IP address. That is simple. No? Jack On Wed, 26 Jan 2005 16:09:13 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Since this is SOAP and a dynamic feature, wouldn't and IP address work as well, or better? Jack On Wed, 26 Jan 2005 07:12:03 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: David, My Struts app contains an Axis-based SOAP service. The Struts app initializes the call dispatcher for the SOAP service. This dispatcher needs to know the URL of itself. This is a requirement of the semantics of the SOAP service (outside of my control). So a Listener or a Plug In appear to be the only way to try to determine the URL before the SOAP service is open for business. Thanks. --Marty --- David Suarez [EMAIL PROTECTED] wrote: Is your plug-in a 3rd party type component? What is the purpose of obtaining the URL? Maybe there's a suitable alternative depending on your requirements (ie. A Filter that would instantiate the objects you need to populate on the first request? A base action that lazy loads your config stuff?) Just a thought...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:18 AM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL I am looking for the: http://blahblahblah.com:8080/AppName/ As Craig said I can get that if I have a Request object. But from a PlugIn I don't have that. I can think of some ugly hacks but nothing clean. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Do you want the URL or the Internet Protocol address? I have some ideas on the latter. Jack On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: Jack, That tells me where the JAR files are stored which is cool. But what I am looking for a valid URL (of which there may be many) to access my given web application. This info has to come from the container which may be the problem. I don't see anything in the container standard which provides this info. Any other ideas? --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Not sure what you want. Does this help? package whatever; import java.io.File; import java.net.URL; public final class Classpath { public static final String SLASH= File.separator; public static final String HERE = Classpath.class.getClassLoader().getResource(whatever + SLASH + Classpath.class).getFile(); } On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: As far as I can tell the attributes offer no insight. I have yet to find a way to get to the container from within a PlugIn. But I will keep looking. Using an initParam is not an option in this application. --Marty --- Frank W. Zammetti [EMAIL PROTECTED] wrote: The OP was looking for a way to construct the entire path. I too got as far as ServletContext, but I'm not sure what in it would give you that, or even all the pieces to constuct it... Maybe getAttribute()? I'm not sure what it will return, although you can use getAttributeNames() to see. The Javadocs indicates the attributes are container-specific though, so I'm not sure he'd want to use that anyway. This is just a matter of curiosity for me at this point, I long ago solved this problem another way. I'd like to know how to do it though. -- Frank W. Zammetti Founder and Chief
RE: PlugIn and the base URL
Forgot to add the disclaimers..: 1) Craig's point is correct. Something like the below kind of defeats any load balancing type setup that may exist on a more generic host name 2) In my mind, web services are great for the cross-platform/external service. But if the only one that knows the location of the where the web service is the webapp, why not call the logic directly instead of via a web service? Again, I'm probably not understanding what you're doing but I hope the thoughts above help you to decide the best thing for you. Regards...djsuarez -Original Message- From: David Suarez Sent: Thursday, January 27, 2005 8:12 AM To: 'Martin Wegner'; Struts Users Mailing List; Dakota Jack Subject: RE: PlugIn and the base URL The light came on when the ip address is sufficient came up. I had context paths and ports in my head. If that's all you need, look at the INetAddress classes which have methods to get a host name and ip address for the localhost. Regards...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 11:51 PM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL Thanks to everybody who contributed to this topic. There appears to be no foolproof solution to the particular problem that I have. I think I will have to go with an external installer/config program. Thanks again to everybody. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Anyway, if an IP address is sufficient, and why wouldn't it be (?), then all you have to do is to provide a servlet to tell all machines that ask their IP address. That is simple. No? Jack On Wed, 26 Jan 2005 16:09:13 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Since this is SOAP and a dynamic feature, wouldn't and IP address work as well, or better? Jack On Wed, 26 Jan 2005 07:12:03 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: David, My Struts app contains an Axis-based SOAP service. The Struts app initializes the call dispatcher for the SOAP service. This dispatcher needs to know the URL of itself. This is a requirement of the semantics of the SOAP service (outside of my control). So a Listener or a Plug In appear to be the only way to try to determine the URL before the SOAP service is open for business. Thanks. --Marty --- David Suarez [EMAIL PROTECTED] wrote: Is your plug-in a 3rd party type component? What is the purpose of obtaining the URL? Maybe there's a suitable alternative depending on your requirements (ie. A Filter that would instantiate the objects you need to populate on the first request? A base action that lazy loads your config stuff?) Just a thought...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:18 AM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL I am looking for the: http://blahblahblah.com:8080/AppName/ As Craig said I can get that if I have a Request object. But from a PlugIn I don't have that. I can think of some ugly hacks but nothing clean. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Do you want the URL or the Internet Protocol address? I have some ideas on the latter. Jack On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: Jack, That tells me where the JAR files are stored which is cool. But what I am looking for a valid URL (of which there may be many) to access my given web application. This info has to come from the container which may be the problem. I don't see anything in the container standard which provides this info. Any other ideas? --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Not sure what you want. Does this help? package whatever; import java.io.File; import java.net.URL; public final class Classpath { public static final String SLASH= File.separator; public static final String HERE = Classpath.class.getClassLoader().getResource(whatever + SLASH + Classpath.class).getFile(); } On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: As far as I can tell the attributes offer no insight. I have yet to find a way to get to the container from within a PlugIn. But I will keep looking. Using an initParam is not an option in this application. --Marty --- Frank W. Zammetti [EMAIL PROTECTED] wrote: The OP was looking for a way to
Popup window submitting to action
Hello, I've got a slighty off topic question for the group. I've got a pop-up window that I use in my application where my client can create a new contact. I wish to have the information write to the database, and close the pop-up window, and then refresh the page it came from. I know this can be done, and I wondered if anyone could show me what I need to do to trigger that stuff. Thanks Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Very OT] Hypothetical challege
Yes, persisting the session data in a database is the obvious answer. No question that I agree with that. However, I was trying to find a solution that would get a bit EJB-happy. I guess, I am not really sure myself what I am asking... I was just trying to stretch the use of Stateful EJBs and its handle, but the question didn't come out right... Never mind. Sorry for wasting your time and thanks for your replies anyway. Thanks, Yaakov. -Original Message- From: Larry Meadors [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 5:48 PM To: Struts Users Mailing List Subject: Re: [Very OT] Hypothetical challege On Wed, 26 Jan 2005 14:40:11 -0800, Wiebe de Jong [EMAIL PROTECTED] wrote: If you don't like the performance hit of going to the database every time, then add a plugin. When the application starts, the plugin will read all the sessions from the database into memory. When the application ends, the plugin would write out all the sessions to the database. Or, use JMS to write the changes, so they happen asynchronously. - 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: Popup window submitting to action
There's probably a couple of ways to do this, here's one... I think you can handle the submitting on the popup and closing the window no problem, but before you do the close, call a Javascript function in the parent of the popup that will submit a form to do the refresh of the main page. That's it, simple. That might actually be the simplest answer. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 10:04 am, Brandon Mercer said: Hello, I've got a slighty off topic question for the group. I've got a pop-up window that I use in my application where my client can create a new contact. I wish to have the information write to the database, and close the pop-up window, and then refresh the page it came from. I know this can be done, and I wondered if anyone could show me what I need to do to trigger that stuff. Thanks Brandon - 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: Popup window submitting to action
Hello Brandon, You could do the following: after submitting the form in the pop up window, redirect to a page that: 1/ Refreshes its parent with javascript (opener), 2/ closes itself (with javascript, again) You can fire the 2 events in the onload event of the body. HTH Renaud PS: This is independent of Struts use. Brandon Mercer [EMAIL PROTECTED] 27/01/2005 16:04 Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Popup window submitting to action Hello, I've got a slighty off topic question for the group. I've got a pop-up window that I use in my application where my client can create a new contact. I wish to have the information write to the database, and close the pop-up window, and then refresh the page it came from. I know this can be done, and I wondered if anyone could show me what I need to do to trigger that stuff. Thanks Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PlugIn and the base URL
You cannot count on this. You need to go outside to an external machine and ask it who you are. You might, for example, be on an intranet and only have a local address from your machines point of view. Jack On Thu, 27 Jan 2005 08:11:54 -0600, David Suarez [EMAIL PROTECTED] wrote: The light came on when the ip address is sufficient came up. I had context paths and ports in my head. If that's all you need, look at the INetAddress classes which have methods to get a host name and ip address for the localhost. Regards...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 11:51 PM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL Thanks to everybody who contributed to this topic. There appears to be no foolproof solution to the particular problem that I have. I think I will have to go with an external installer/config program. Thanks again to everybody. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Anyway, if an IP address is sufficient, and why wouldn't it be (?), then all you have to do is to provide a servlet to tell all machines that ask their IP address. That is simple. No? Jack On Wed, 26 Jan 2005 16:09:13 -0800, Dakota Jack [EMAIL PROTECTED] wrote: Since this is SOAP and a dynamic feature, wouldn't and IP address work as well, or better? Jack On Wed, 26 Jan 2005 07:12:03 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: David, My Struts app contains an Axis-based SOAP service. The Struts app initializes the call dispatcher for the SOAP service. This dispatcher needs to know the URL of itself. This is a requirement of the semantics of the SOAP service (outside of my control). So a Listener or a Plug In appear to be the only way to try to determine the URL before the SOAP service is open for business. Thanks. --Marty --- David Suarez [EMAIL PROTECTED] wrote: Is your plug-in a 3rd party type component? What is the purpose of obtaining the URL? Maybe there's a suitable alternative depending on your requirements (ie. A Filter that would instantiate the objects you need to populate on the first request? A base action that lazy loads your config stuff?) Just a thought...djsuarez -Original Message- From: Martin Wegner [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:18 AM To: Struts Users Mailing List; Dakota Jack Subject: Re: PlugIn and the base URL I am looking for the: http://blahblahblah.com:8080/AppName/ As Craig said I can get that if I have a Request object. But from a PlugIn I don't have that. I can think of some ugly hacks but nothing clean. --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Do you want the URL or the Internet Protocol address? I have some ideas on the latter. Jack On Tue, 25 Jan 2005 21:05:30 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: Jack, That tells me where the JAR files are stored which is cool. But what I am looking for a valid URL (of which there may be many) to access my given web application. This info has to come from the container which may be the problem. I don't see anything in the container standard which provides this info. Any other ideas? --Marty --- Dakota Jack [EMAIL PROTECTED] wrote: Not sure what you want. Does this help? package whatever; import java.io.File; import java.net.URL; public final class Classpath { public static final String SLASH= File.separator; public static final String HERE = Classpath.class.getClassLoader().getResource(whatever + SLASH + Classpath.class).getFile(); } On Tue, 25 Jan 2005 19:25:21 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: As far as I can tell the attributes offer no insight. I have yet to find a way to get to the container from within a PlugIn. But I will keep looking. Using an initParam is not an option in this application. --Marty --- Frank W. Zammetti [EMAIL PROTECTED] wrote: The OP was looking for a way to construct the entire path. I too got as far as ServletContext, but I'm not sure what in it would give you that, or even all the pieces to constuct it... Maybe getAttribute()? I'm not sure what it will
Re: Popup window submitting to action
[EMAIL PROTECTED] wrote: There's probably a couple of ways to do this, here's one... I think you can handle the submitting on the popup and closing the window no problem, but before you do the close, call a Javascript function in the parent of the popup that will submit a form to do the refresh of the main page. That's it, simple. That might actually be the simplest answer. Thanks guys! I realize this is not a struts thing :-) but since struts is a web application toolkit that promotes best practices I figured someone on here would be able to provide me with a clean solution. :-) Here's what I've come up with... except I don't know how to do the form that refreshes me main page. The form submits... action=/addcontact... returns success page in that window. The success page has a: script language=javascript function refreshForm() { opener... (I DUNNO WHAT TO DO HERE) window.close(); } /script body onload=refreshForm() Thanks for the help :-P Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
custom validator stopped working
I have a very simple custom validator that checks if a select list has 1 or more selections. when I upgraded to struts 1.2.6 it stopped working. I have done all the things in http://wiki.apache.org/struts/StrutsUpgradeNotes11to124 ie change the validator dtd I also tried using the most recent version of the validator jar 1.1.4. I even created a validator that always returns false public static boolean validateRequiredMultilist( Object bean, ValidatorAction va, Field field, ActionErrors errors, HttpServletRequest request) { return false; } It didn't seem to do anything but empty selections got by as valid. My validator-rule-custom.xml contains the entry validator name=requiredmultilist classname=org.ycmi.validators.MultilistValidator method=validateRequiredMultilist methodParams=java.lang.Object, org.apache.commons.validator.ValidatorAction, org.apache.commons.validator.Field, org.apache.struts.action.ActionErrors, javax.servlet.http.HttpServletRequest msg=errors.multilist /validator The builtins seem to be working fine. I must be missing something very fundamental/simple. Any help would be appreciated. mas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Popup window submitting to action
Assume you have a form in the parent window that does your refresh, whether it's visible to the user or not (i.e., has nothing but hidden fields). Simply do: parent.theForm.submit(); For that line you weren't sure about. Should do the trick. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 10:30 am, Brandon Mercer said: [EMAIL PROTECTED] wrote: There's probably a couple of ways to do this, here's one... I think you can handle the submitting on the popup and closing the window no problem, but before you do the close, call a Javascript function in the parent of the popup that will submit a form to do the refresh of the main page. That's it, simple. That might actually be the simplest answer. Thanks guys! I realize this is not a struts thing :-) but since struts is a web application toolkit that promotes best practices I figured someone on here would be able to provide me with a clean solution. :-) Here's what I've come up with... except I don't know how to do the form that refreshes me main page. The form submits... action=/addcontact... returns success page in that window. The success page has a: script language=javascript function refreshForm() { opener... (I DUNNO WHAT TO DO HERE) window.close(); } /script body onload=refreshForm() Thanks for the help :-P Brandon - 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 Security
At 10:05 AM + 1/27/05, Tim Christopher wrote: Hi, I've never used EJB so have no idea what this means, can someone explain please? When SecurityFilter is used, a user's Principal will not automatically be propagated to EJB calls. If this is a requirement for your application, you may not be able to use SecurityFilter. If you don't use EJB, then it's not an issue for you, but part of the appeal of container managed security is that it makes the same java.security.Principal (representing the authenticated user) available to both the servlet and the EJB layer code. I haven't used SecurityFilter before, but it looks handy. My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Security
Joe - Your comment My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. struck a chord with me - it's one of the reasons I've never looked at implementing CMS. How do you handle this? Roll your own? Jerry Jalenak Senior Programmer / Analyst, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:32 AM To: Tim Christopher; Struts Users Mailing List Subject: Re: Struts Security At 10:05 AM + 1/27/05, Tim Christopher wrote: Hi, I've never used EJB so have no idea what this means, can someone explain please? When SecurityFilter is used, a user's Principal will not automatically be propagated to EJB calls. If this is a requirement for your application, you may not be able to use SecurityFilter. If you don't use EJB, then it's not an issue for you, but part of the appeal of container managed security is that it makes the same java.security.Principal (representing the authenticated user) available to both the servlet and the EJB layer code. I haven't used SecurityFilter before, but it looks handy. My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Security
Joe - Your comment My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. struck a chord with me - it's one of the reasons I've never looked at implementing CMS. How do you handle this? Roll your own? Jerry Jalenak Senior Programmer / Analyst, Web Publishing LabOne, Inc. 10101 Renner Blvd. Lenexa, KS 66219 (913) 577-1496 [EMAIL PROTECTED] -Original Message- From: Joe Germuska [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:32 AM To: Tim Christopher; Struts Users Mailing List Subject: Re: Struts Security At 10:05 AM + 1/27/05, Tim Christopher wrote: Hi, I've never used EJB so have no idea what this means, can someone explain please? When SecurityFilter is used, a user's Principal will not automatically be propagated to EJB calls. If this is a requirement for your application, you may not be able to use SecurityFilter. If you don't use EJB, then it's not an issue for you, but part of the appeal of container managed security is that it makes the same java.security.Principal (representing the authenticated user) available to both the servlet and the EJB layer code. I haven't used SecurityFilter before, but it looks handy. My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This transmission (and any information attached to it) may be confidential and is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient or the person responsible for delivering the transmission to the intended recipient, be advised that you have received this transmission in error and that any use, dissemination, forwarding, printing, or copying of this information is strictly prohibited. If you have received this transmission in error, please immediately notify LabOne at the following email address: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How I decided to handle the dynamic titles/label problem with Tiles
Dakota Jack wrote the following on 1/27/2005 12:24 AM: For me, and of course I speak for myself alone, I could not stand the view being so tightly bound as your suggestion. Maybe I misunderstand what you are doing. The reason I like the approach I favor is that you can write the Struts code in the Action, etc., and the code on the JSP pages without knowing a thing about what is happening behind the scenes. You really don't even need collaboration. You can even write simply tools to build test classes by code generation for whatever is on the JSP pages without much difficulty. I'd be interested more in how you would handle this. I do not like the view 'tightly' bound with Actions either, but reality often kicks in and sometimes I don't see a convenient way to handle things. So, I'll throw the question then back to you concerning how you would handle the problem at hand... To make it simple imagine you want a title to display that is based in a reusable layout page that can have some dynamic information based on 'what was done' in your business method. For example you want a title to display: Updating user John Doe of Acme Company Explain to me where you would set John Doe and set Acme Company so that the title section of a tile would have access to those values? I do not see how you can abstract that out very much. You might be able to put another layer (possibly a post filter) where you can code some logic that determines where you are going and what it needs to get out and set up for the view. I thought of this approach and I find it ends up doing yet another problem I see in so many web apps - over complication. We think we are simplifying things and making things more clean yet when in actuality it just makes things more confusing - especially to a new person that comes on board. So I'd be interested in your approach to the real world problem above. I often use the same approach when setting up some custom success messages. For example your view layer might not have access to a User object yet your action when you saved does, but you might want display a success message such as John Doe of 1245 North Street was successfully updated Of course remember I'm not putting the exact syntax of the message into scope from the Action - I'm just adding the relevant params the MessageResources needs ie: messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(message.update.success, userName, companyName)); saveMessages(request, messages); I'm probably just being dense but I don't see what the following, you mention, would help with: Also, I like to have this state object wrapped such that there is an interface not unlike getState(...) for either the Action or the model. Whatever is in between the interface and the map is purely implementation and subject to whatever choices, improvements, etc. one might make. I'd really appreciate more feedback with a practical example, using the situation provided above. Thanks a lot. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Popup window submitting to action
Cedric Levieux wrote: Here what you want in the page retrieved after the submit action and reached via this action : html head /head body script language=JavaScript !-- window.opener.location.reload(); window.close(); // -- /script Thanks, it works BEAUTIFULLY :-D Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Popup window submitting to action
Well, you could either (a) create a form with an action of billpay.do and submit it, or (b) you could do parent.location=billpay.do. That should essentially do a refresh. I'm not aware of any refresh method, unless you are OK with IE-only code... IE has a number of commands, as they are called, that can do a ton of extra stuff. Look for the execCommand() method, I think of the document object. I'll assume you don't want to do that though (I wouldn't), so just set location, that should do it. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 10:49 am, Brandon Mercer said: [EMAIL PROTECTED] wrote: Assume you have a form in the parent window that does your refresh, whether it's visible to the user or not (i.e., has nothing but hidden fields). Simply do: parent.theForm.submit(); I don't think that's going to work. Actually I know that it doesn't work. I've got an action that doesn't have a form to create this page. The link to the page is billpay.do and it doesn't have a form... all I do is get stuff from a database and put it into drop downs. How would I do parent.refresh();??? parent.reload();??? Thanks, Brandon P.S. I'm excited because we're close! - 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: Popup window submitting to action
reload()... cool, didn't see that in my reference book. Everyone learns something new every day! :) (sure seemed like something that would be there, glad to know I just missed it) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 10:54 am, Brandon Mercer said: Cedric Levieux wrote: Here what you want in the page retrieved after the submit action and reached via this action : html head /head body script language=JavaScript !-- window.opener.location.reload(); window.close(); // -- /script Thanks, it works BEAUTIFULLY :-D Brandon - 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: Losing changed form value
Thanks for your advice! I've checked the ActionMappings and they all mention the request scope: action path=/profile/personal_profile type=com.xxx.users.actions.GetCurrentUserProfileAction scope=request name=userProfileForm validate=false parameter=.main.profile.personalProfile/action ... !-- Email address updates -- action path=/profile/personal_profile/email type=com.xxx.users.actions.GetUserProfileAction scope=request name=userProfileForm validate=false parameter=.main.profile.personalProfile.email/action action path=/profile/personal_profile/email/update/confirm type=com.xxx.users.actions.ConfirmUpdateUser scope=request name=userProfileForm validate=true input=update_company_user forward name=success path=.main.profile.personalProfile.email.update.confirm/ forward name=error path=/profile/personal_profile/email.do/ /action action path=/profile/personal_profile/email/update/perform type=com.xxx.users.actions.UpdateCurrentUserAction name=userProfileForm scope=request validate=true forward name=success path=/profile/personal_profile.do redirect=true/ forward name=error path=/profile/personal_profile/email.do/ /action The userProfileForm maps to: form-bean name=userProfileForm type=com.xxx.users.forms.UserProfileForm/ and that class looks pretty normal: it extends ValidatorForm. The GetCurrentUserProfile class extends xxxAction, which extends Action. Both of the classes look pretty benign to me: neither explicitly places the form into any particular context, so I presume that's left to the Action class, which my mapping says should be putting it into request scope (I think). I'll bet it's staring me in the face, but I still don't see it. Do you see anything I might have missed? Thanks again for your help! Can't promise this, but make SURE your Action Mappings specifically define the scope of your form bean. My HUNCH is that the one that displays the first time is in session scope, but your submit action is defining one in request scope. w Christopher Loschen wrote: Hi all, The action classes do seem to be updating the form correctly, but if they were, I'd get the updated data, right? Yours, Chris Yours, Chris Loschen [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to integrate struts project with hibernate?
Metin, I know someone who has integrated Hibernate with the ADFm DataBinding layer in JDeveloper. So you can use Drag and drop databinding onto Pages and Struts Actions, in the same way you can bind to EJB, TopLink, ADF Business Components or WebServices. If you're interested I'll send you what I can find offline. Duncan dot mills at oracle dot com Regards Duncan Mills Metin Erksan wrote: hi i try to integrate my struts project with hibernate.i m newbie about hibernate.i use jdeveloper10g. i googled but i found a few samples that use hibernate plugin for struts . is there any document or startup sample for struts-hibernate? at the beginning i searched for struts-spring comparison but i couldnot find .i want to know experienced users with hibernate.do they use hibernate with struts or spring ? and why ? i m at the beginning of project. your sincerely __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - 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 Security
At 9:46 AM -0600 1/27/05, Jerry Jalenak wrote: Joe - Your comment My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. struck a chord with me - it's one of the reasons I've never looked at implementing CMS. How do you handle this? Roll your own? Yes; it's not too hard to come up with a simple user model, although obviously more sophisticated apps can be a headache to build from scratch. If you have some mechanism to get a user into the session, then it's not too hard to override the processRoles step in the request process to provide struts-config level declarative security comparable to what happens by default using container-managed security. I haven't had call to try to replicate the tag-library behavior. We usually have interfaces that are different enough based on role that it's just as well to have separate templates as to try to have one with a bunch of conditionals. There was a pretty good JDJ article about two years ago which laid out all the flaws of container based security -- besides the aforementioned no-user-initiated login, it's pretty hard to use container managed security on resources which don't *require* authentication, but behave differently after authentication. I never tried to use their implementation, and the Filter-nature of Security Filter makes it look like probably a better solution to the same problem. (Two years ago, we may not have been on Servlet 2.3 yet, but that's not an issue now...) Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts and Sun Application Server 8
Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance.
Struts and Sun Application Server 8
Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance.
Struts list and spam
Dear all, Does anyone know why full email addresses are showing on the List archive? Isn't this just asking it for it?! It's just a bit disconcerting that any spam crawler can pick up anyone's email address that ever posted to the list. Is there a way to fix this? Does anyone know who needs to be contacted and alerted about this problem? I've seen people trying protect their email addresses while posting messages to this list with first dot last at name dot com. Do these people realize that it's all in vain when posting to this list? Thanks, Yaakov. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Security
On Thu, 27 Jan 2005 11:02:35 -0600, Joe Germuska [EMAIL PROTECTED] wrote: At 9:46 AM -0600 1/27/05, Jerry Jalenak wrote: Joe - Your comment My main issue with Container Based auth is its inability to support user-initiated login -- it only works by intercepting a request for a normal resource and then challenging for login. struck a chord with me - it's one of the reasons I've never looked at implementing CMS. How do you handle this? Roll your own? Look at what appfuse does. Matt Raible has user initiated and remember me functionality with CMS. It's not really that complicated. Yes; it's not too hard to come up with a simple user model, although obviously more sophisticated apps can be a headache to build from scratch. If you have some mechanism to get a user into the session, then it's not too hard to override the processRoles step in the request process to provide struts-config level declarative security comparable to what happens by default using container-managed security. I haven't had call to try to replicate the tag-library behavior. We usually have interfaces that are different enough based on role that it's just as well to have separate templates as to try to have one with a bunch of conditionals. There was a pretty good JDJ article about two years ago which laid out all the flaws of container based security -- besides the aforementioned no-user-initiated login, it's pretty hard to use container managed security on resources which don't *require* authentication, but behave differently after authentication. I never tried to use their implementation, and the Filter-nature of Security Filter makes it look like probably a better solution to the same problem. (Two years ago, we may not have been on Servlet 2.3 yet, but that's not an issue now...) Joe -- Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com Narrow minds are weapons made for mass destruction -The Ex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and Sun Application Server 8
On Thu, 27 Jan 2005 11:17:15 -0600, Brent Vaughn [EMAIL PROTECTED] wrote: Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance. If Sun is a JSP and Servlet spec compliant container, yes. I think, and don't quote me, that sun is using Tomcat under the covers. -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] java logging in JApplet
Hi I want to use java logging API in applet, i want to use ConsoleHandler to get all the logs in my java console, also i want to have a JDialog where i will display various logging level options and then set the log level from the selected option. I dont want to use a properties file to set Log level, how will i get it working if my package name is com.test.applet and all the applet classes are inside this package Ashish __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Are you using Tapestry?
http://howardlewisship.com/blog/2005/01/safety-first.html And I didn't even realize there was animositywhat a fool I've been :P -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] java logging in JApplet
On Thu, 27 Jan 2005 09:25:18 -0800 (PST), Ashish Kulkarni [EMAIL PROTECTED] wrote: Hi I want to use java logging API in applet, i want to use ConsoleHandler to get all the logs in my java console, also i want to have a JDialog where i will display various logging level options and then set the log level from the selected option. I dont want to use a properties file to set Log level, how will i get it working if my package name is com.test.applet and all the applet classes are inside this package 1) Read the log tutorail for java on the sun site. 2) Ask on a java or applet mailing list. Ashish __ Do you Yahoo!? The all-new My Yahoo! - Get yours free! http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Parse XML Files
Hi Guys, I'm new to struts and JSP and need to parse and compare XML files. I know you can do this with JSTL tags, but wanting to stick to the struts framework, I want to seperate my business method from my JSPs. Is their a standard way of doing this in struts, maybe using JAXP, or should I stick to JSTL? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Are you using Tapestry?
On Thu, 27 Jan 2005 12:27:57 -0500, James Mitchell [EMAIL PROTECTED] wrote: http://howardlewisship.com/blog/2005/01/safety-first.html And I didn't even realize there was animositywhat a fool I've been :P Tha'ts too funny. The counter to that is: Friends who don't want friends to compete against them in the open market let those friends code Tapestry. -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parse XML Files
What kind of xml is it? A static config type file? One that gets uploaded by the user? -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Nelson [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, January 27, 2005 12:23 PM Subject: Parse XML Files Hi Guys, I'm new to struts and JSP and need to parse and compare XML files. I know you can do this with JSTL tags, but wanting to stick to the struts framework, I want to seperate my business method from my JSPs. Is their a standard way of doing this in struts, maybe using JAXP, or should I stick to JSTL? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts and Sun Application Server 8
Why is it when I go to deploy my Struts application as a WAR to the Sun Application Server that it writes over my web.xml file with its own version of the web.xml file? Theirs leaves out all the necessary Struts components in the web.xml file and you can't delete their web.xml file and replace it with your own. How do you get around this problem? -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:20 AM To: Struts Users Mailing List Subject: Re: Struts and Sun Application Server 8 On Thu, 27 Jan 2005 11:17:15 -0600, Brent Vaughn [EMAIL PROTECTED] wrote: Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance. If Sun is a JSP and Servlet spec compliant container, yes. I think, and don't quote me, that sun is using Tomcat under the covers. -- James A Barrows - 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 and Sun Application Server 8
Why is it when I go to deploy my Struts application as a WAR to the Sun Application Server that it writes over my web.xml file with its own version of the web.xml file? Theirs leaves out all the necessary Struts components in the web.xml file and you can't delete their web.xml file and replace it with your own. How do you get around this problem? -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:20 AM To: Struts Users Mailing List Subject: Re: Struts and Sun Application Server 8 On Thu, 27 Jan 2005 11:17:15 -0600, Brent Vaughn [EMAIL PROTECTED] wrote: Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance. If Sun is a JSP and Servlet spec compliant container, yes. I think, and don't quote me, that sun is using Tomcat under the covers. -- James A Barrows - 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: Parse XML Files
On Thu, 27 Jan 2005 17:23:55 + (UTC), Nelson [EMAIL PROTECTED] wrote: Hi Guys, I'm new to struts and JSP and need to parse and compare XML files. I know you can do this with JSTL tags, but wanting to stick to the struts framework, I want to seperate my business method from my JSPs. Is their a standard way of doing this in struts, maybe using JAXP, or should I stick to JSTL? Well, seperating business logic out is good. Getting the xml comparison out of struts and into a business object of some kind is even better :) I would use JAXP or Jakarta Commons Betwixt depending on what I wanted to compare. Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Parse XML Files
JDOM is a nice open-source XML manipulation library. http://www.jdom.org/ -Original Message- From: Nelson [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 10:24 AM To: user@struts.apache.org Subject: Parse XML Files Hi Guys, I'm new to struts and JSP and need to parse and compare XML files. I know you can do this with JSTL tags, but wanting to stick to the struts framework, I want to seperate my business method from my JSPs. Is their a standard way of doing this in struts, maybe using JAXP, or should I stick to JSTL? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
Even more bizarre that it's a sibling Apache project. Along that same line, I thought this was just hilarious: http://www.lightbody.net/~plightbo/archives/000144.html Because, and I'll risk a generalization here, the WebWork devs have always been pretty public about their loathing of Struts. Now that there's a lot of buzz around Rails, Stuts seems to have magically fallen off their radar. I'll just take another quick second to use these two examples as an indirect way to compliment the Struts community (especially the devs) on how they deal with other web frameworks. There's more to a project than the code... Quoting James Mitchell [EMAIL PROTECTED]: http://howardlewisship.com/blog/2005/01/safety-first.html And I didn't even realize there was animositywhat a fool I've been :P -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Parse XML Files
The reason I asked is if it is static and predictable, check out the DigestingPlugin. I've used it and it works well... http://struts.apache.org/api/org/apache/struts/plugins/DigestingPlugIn.html -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: James Mitchell [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Thursday, January 27, 2005 12:38 PM Subject: Re: Parse XML Files What kind of xml is it? A static config type file? One that gets uploaded by the user? -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx - Original Message - From: Nelson [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, January 27, 2005 12:23 PM Subject: Parse XML Files Hi Guys, I'm new to struts and JSP and need to parse and compare XML files. I know you can do this with JSTL tags, but wanting to stick to the struts framework, I want to seperate my business method from my JSPs. Is their a standard way of doing this in struts, maybe using JAXP, or should I stick to JSTL? 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]
Re: [OT] Are you using Tapestry?
On Thu, 27 Jan 2005 12:40:51 -0500, Kris Schneider [EMAIL PROTECTED] wrote: Even more bizarre that it's a sibling Apache project. Along that same line, I thought this was just hilarious: I'm taking this in a friendly competitive way rather then as animosity. http://www.lightbody.net/~plightbo/archives/000144.html Because, and I'll risk a generalization here, the WebWork devs have always been pretty public about their loathing of Struts. Now that there's a lot of buzz around Rails, Stuts seems to have magically fallen off their radar. The interesting things is that, they're right about direct mapping tables to UI. If you're trying to do anything beyond CRUD direct mapping doesn't work. I've even agreed with some of their comments about Struts. It has it's warts. However, the warts are going away, and Struts, unlike any of it's leading competitors does JSP better. Then of course, you have the simple fact that I've seen more requests for Struts skills then I have for WebWork or Tapestry. I'll just take another quick second to use these two examples as an indirect way to compliment the Struts community (especially the devs) on how they deal with other web frameworks. There's more to a project than the code... Quoting James Mitchell [EMAIL PROTECTED]: http://howardlewisship.com/blog/2005/01/safety-first.html And I didn't even realize there was animositywhat a fool I've been :P -- James Mitchell Software Engineer / Open Source Evangelist EdgeTech, Inc. 678.910.8017 AIM: jmitchtx -- Kris Schneider mailto:[EMAIL PROTECTED] D.O.Tech http://www.dotech.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts and Sun Application Server 8
On Thu, 27 Jan 2005 11:44:16 -0600, Brent Vaughn [EMAIL PROTECTED] wrote: Why is it when I go to deploy my Struts application as a WAR to the Sun Application Server that it writes over my web.xml file with its own version of the web.xml file? Theirs leaves out all the necessary Struts components in the web.xml file and you can't delete their web.xml file and replace it with your own. How do you get around this problem? Use Tomcat :) I dunno I don't use the Sun Application Server at all. I've downloaded it and tinkered with it, but not really done anything with it. I don't remember it overwriting my web.xml file. -Original Message- From: Jim Barrows [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:20 AM To: Struts Users Mailing List Subject: Re: Struts and Sun Application Server 8 On Thu, 27 Jan 2005 11:17:15 -0600, Brent Vaughn [EMAIL PROTECTED] wrote: Are Struts and the Sun Application Server 8 compliant with one another? This maybe a dumb question. If so, sorry in advance. If Sun is a JSP and Servlet spec compliant container, yes. I think, and don't quote me, that sun is using Tomcat under the covers. -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another ODBC OT Question
Hello, Ok, I've got another off topic question :-P. That's two in a day! Three strikes and I'm out. lol Anyhow, I am inserting information into a database and I need to get the auto_increment value from my first insert and use the value it returns to create an entry in another table. Does anyone have a code snippet that they could show me? Thanks, Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Jan 27, 2005, at 18:50, Jim Barrows wrote: http://www.lightbody.net/~plightbo/archives/000144.html RoR is simply a RESTful CRUD framework sounds like very high praise to my uninformed hears :) If you're trying to do anything beyond CRUD direct mapping doesn't work. Hmmm... care to elaborate and expend a bit on that line of thoughts? Concrete example would greatly help in understanding what precisely doesn't work as you see it. As an asside, are you familiar with Zope's ObjectPublishing? http://zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Another ODBC OT Question
What rdbms are you using? -Original Message- From: Brandon Mercer [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 10:56 AM To: Struts Users Mailing List Subject: Another ODBC OT Question Hello, Ok, I've got another off topic question :-P. That's two in a day! Three strikes and I'm out. lol Anyhow, I am inserting information into a database and I need to get the auto_increment value from my first insert and use the value it returns to create an entry in another table. Does anyone have a code snippet that they could show me? Thanks, Brandon - 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: Another ODBC OT Question
Barnett, Brian W. wrote: What rdbms are you using? Sorry, that would have been helpful huh! lol MySQL Connector/J (obviously) 3.0.x. I think I know how to get the last id... but do I create another insert the same way I did the first? Thanks, Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Popup window submitting to action
FYI.. I had a need for something similar to this in the past and later the same popup page ended up needing to allow handling of user errors/validation errors. What I ended up doing was submitting within the popup instead of directly to the parent as below. This allows you to be able to handle validation errors while still in the parent. The success path can be a separate page that contains the javascript which closes the popup and loads the parent into the appropriate forward. You may want to do this up front if you foresee a need for this now. Hope it helps. Regards...djsuarez -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 9:56 AM To: user@struts.apache.org Subject: Re: Popup window submitting to action reload()... cool, didn't see that in my reference book. Everyone learns something new every day! :) (sure seemed like something that would be there, glad to know I just missed it) -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 10:54 am, Brandon Mercer said: Cedric Levieux wrote: Here what you want in the page retrieved after the submit action and reached via this action : html head /head body script language=JavaScript !-- window.opener.location.reload(); window.close(); // -- /script Thanks, it works BEAUTIFULLY :-D Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Thu, 27 Jan 2005 19:03:21 +0100, PA [EMAIL PROTECTED] wrote: On Jan 27, 2005, at 18:50, Jim Barrows wrote: http://www.lightbody.net/~plightbo/archives/000144.html RoR is simply a RESTful CRUD framework sounds like very high praise to my uninformed hears :) If you're trying to do anything beyond CRUD direct mapping doesn't work. Hmmm... care to elaborate and expend a bit on that line of thoughts? Concrete example would greatly help in understanding what precisely doesn't work as you see it. I'm speaking of frameworks that do a lot of the work for you, which Rails seems to. 1) Tracking every change and view made to or of a record. The record doesn't necessarily come from one table. 2) Any odd mix of SQL and stored procedures. Which is how 1 was implemented. No I didn't implement, no I couldn't change it, and no I don't I don't want to remember anymore. 3) Restricting CRUD functionality by record, or part of record. Again where a record is not one table. 4) Anywhere one page updates more then one table. My personal favorite: Mapping a UseCase object, Actor object and the 0+ Diagrams on which they can be viewed. UseCase can refer to one and only one actor, while and actor can have 1 or more uscases. This is not a parent child relationship, but a peer relationship. Any Actor/UseCase can appear on more then one diagram. Diagrams, just to really muck things up , inherit from Artifact. A project has 1 or more Artifacts, and there is a whole heirarchy of Artifacts that a project might have. As an asside, are you familiar with Zope's ObjectPublishing? http://zope.org/Documentation/Books/ZDG/current/ObjectPublishing.stx Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Another ODBC OT Question
I googled this: http://www.google.com/search?sourceid=navclientie=UTF-8rls=GGLD,GGLD:2004-11,GGLD:enq=jdbc+mysql+auto%5Fincrement and found this: http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html It was too easy, so it's probably the wrong thing. Brandon Mercer [EMAIL PROTECTED] 01/27/2005 01:17 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Another ODBC OT Question Barnett, Brian W. wrote: What rdbms are you using? Sorry, that would have been helpful huh! lol MySQL Connector/J (obviously) 3.0.x. I think I know how to get the last id... but do I create another insert the same way I did the first? Thanks, Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Losing changed form value
On Thu, 27 Jan 2005 11:40:45 -0500, Christopher Loschen [EMAIL PROTECTED] wrote: Thanks for your advice! I've checked the ActionMappings and they all mention the request scope: action path=/profile/personal_profile type=com.xxx.users.actions.GetCurrentUserProfileAction scope=request name=userProfileForm validate=false parameter=.main.profile.personalProfile/action ... !-- Email address updates -- action path=/profile/personal_profile/email type=com.xxx.users.actions.GetUserProfileAction scope=request name=userProfileForm validate=false parameter=.main.profile.personalProfile.email/action action path=/profile/personal_profile/email/update/confirm type=com.xxx.users.actions.ConfirmUpdateUser scope=request name=userProfileForm validate=true input=update_company_user forward name=success path=.main.profile.personalProfile.email.update.confirm/ forward name=error path=/profile/personal_profile/email.do/ /action action path=/profile/personal_profile/email/update/perform type=com.xxx.users.actions.UpdateCurrentUserAction name=userProfileForm scope=request validate=true forward name=success path=/profile/personal_profile.do redirect=true/ forward name=error path=/profile/personal_profile/email.do/ /action The userProfileForm maps to: form-bean name=userProfileForm type=com.xxx.users.forms.UserProfileForm/ and that class looks pretty normal: it extends ValidatorForm. The GetCurrentUserProfile class extends xxxAction, which extends Action. Both of the classes look pretty benign to me: neither explicitly places the form into any particular context, so I presume that's left to the Action class, which my mapping says should be putting it into request scope (I think). I'll bet it's staring me in the face, but I still don't see it. Do you see anything I might have missed? After the update of the email you are redirecting to the (/profile/personal_profile.do) GetCurrentUserProfileAction. So, how does the GetCurrentUserProfileAction populate the form with the email address? Doesn't look like the GetCurrentUserProfileAction reads from the database for the new email address Thanks again for your help! Can't promise this, but make SURE your Action Mappings specifically define the scope of your form bean. My HUNCH is that the one that displays the first time is in session scope, but your submit action is defining one in request scope. w Christopher Loschen wrote: Hi all, The action classes do seem to be updating the form correctly, but if they were, I'd get the updated data, right? Yours, Chris Yours, Chris Loschen [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: Another ODBC OT Question
I'm familiar with SQL Server and Oracle, but not MySQL. I suggest you follow DGraham's search results, or google for MySQL, auto increment, primary keys. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 11:23 AM To: Struts Users Mailing List Subject: [OT] Re: Another ODBC OT Question I googled this: http://www.google.com/search?sourceid=navclientie=UTF-8rls=GGLD,GGLD:2004- 11,GGLD:enq=jdbc+mysql+auto%5Fincrement and found this: http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.h tml It was too easy, so it's probably the wrong thing. Brandon Mercer [EMAIL PROTECTED] 01/27/2005 01:17 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Another ODBC OT Question Barnett, Brian W. wrote: What rdbms are you using? Sorry, that would have been helpful huh! lol MySQL Connector/J (obviously) 3.0.x. I think I know how to get the last id... but do I create another insert the same way I did the first? Thanks, Brandon - 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: Another ODBC OT Question
Sorry for all those local disk links and other junk. Cut and paste. Erik Erik Weber wrote: mailbox:///home/eweber/.mozilla/eweber/dtplse79.slt/Mail/mail.mindspring.com/Drafts?number=3515320part=1.2filename=Getting_unique_ID You use MySQL's AUTO_INCREMENT function (then omit the value during an insert and MySQL will insert it for you) and related syntax, which is all covered in the manual: 21.2.12.3 How to Get the Unique ID for the Last Inserted Row mailbox:///home/eweber/.mozilla/eweber/dtplse79.slt/Mail/mail.mindspring.com/Drafts?number=3515320part=1.2filename=Getting_unique_ID If you insert a record into a table that contains an |AUTO_INCREMENT| column, you can obtain the value stored into that column by calling the |mysql_insert_id()| function. You can check whether a value was stored into an |AUTO_INCREMENT| column by executing the following code. This also checks whether the query was an |INSERT| with an |AUTO_INCREMENT| index: if (mysql_error(mysql)[0] == 0 mysql_num_fields(result) == 0 mysql_insert_id(mysql) != 0) { used_id = mysql_insert_id(mysql); } For more information, see section 21.2.3.32 |mysql_insert_id()| mailbox:///home/eweber/.mozilla/eweber/dtplse79.slt/Mail/mail.mindspring.com/Drafts?number=3515320part=1.3filename=manual_Clients.html. When a new |AUTO_INCREMENT| value has been generated, you can also obtain it by executing a |SELECT LAST_INSERT_ID()| statement |mysql_query()| and retrieving the value from the result set returned by the statement. That's straight out of the MySQL 5.0 manual. . . Erik Brandon Mercer wrote: Barnett, Brian W. wrote: What rdbms are you using? Sorry, that would have been helpful huh! lol MySQL Connector/J (obviously) 3.0.x. I think I know how to get the last id... but do I create another insert the same way I did the first? Thanks, Brandon - 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: Another ODBC OT Question
Erik Weber wrote: Sorry for all those local disk links and other junk. Cut and paste. Thanks everyone this article http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html was the ticket for me. We all know how it gets when you're writing code all day long and you start to forget how to function! :-P Thanks for the patience and help. I've got working now. Regards, Brandon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Jan 27, 2005, at 19:20, Jim Barrows wrote: I'm speaking of frameworks that do a lot of the work for you, which Rails seems to. Hmmm... ok... so when you say that, and under some circumstances, CRUD direct mapping doesn't work you barely implies that direct mapping of database record to what someone calling himself Martin Fowler call Active Record is not a 100% solution as far as your experience goes? http://www.martinfowler.com/eaaCatalog/activeRecord.html Which is what RoR does in its own way: http://wiki.rubyonrails.com/rails/show/ActiveRecord Of course, if you simply forget about record and think in terms of object (ActiveObject perhaps?), all is well in the kingdom, right? Also, I fail to quite see what any of this as to do with either Struts or Tapestry in the first place... does Struts or Tapestry concern themselves directly with such mundane persistency issues? I was under the impression that no, they don't. Did I miss something? Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts Security
Also see this article: http://www.javaworld.com/javaworld/jw-07-2004/jw-0726-security.html J2EE security: Container versus custom Choose the appropriate type of security for your application Summary This article covers the factors to consider when choosing between custom security and J2EE standard security, also known as container security. It briefly covers how each type of security works and then illustrates their differences, strengths, and weaknesses. Although J2EE security itself applies to all components of an enterprise application, this discussion's main focus is Web application security or, more specifically, authentication. (6,000 words; July 26, 2004) -- Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
errorStyleClass and lists
Per suggestion, I'm posting a follow up to see if anyone on the list has a solution/suggestions to the issue/enhancement below: http://issues.apache.org/bugzilla/show_bug.cgi?id=33258 Summary: To get around the problem with BeanUtils, I have an actionform with the following list structure: List foos; List getFoos() { return foos; } void setFoos(List foos) { this.foos = foos; } Object getFoo(index) { .. initialize list capacity.. return this.foos.get(index); } In my JSP, I iterate over this list and output elements as so: c:forEach items=foos id=foo html:text errorStyleClass=fooError name=foo property=day indexed=true / /c:forEach This works great and gets/sets my list accordingly. All is well. I created a validation for this list: field indexedListProperty=foos property=day depends=mask ... /field This validates my list and puts errors into the global errors with keys that look like this: foos[xxx].day That's fine, it validates, and stores errors. However, since the key it creates, foos[xxx].day is different than the name of my html:text, foo[xxx].day, the errorStyleClass is never used - the two don't match. As pointed out by Niall (see bug link above), I could use a different method name to get/set the list in my actionform. However, doing this causes a BeanUtils error when the page renders (see related bug Niall included). There seem to be a plethora of examples showing how to get/set lists in the manner I posted above, so assume other people have/will have this issue with errorStyleClass. Does anyone have a work around or suggestion for how to fix this without relying on a change to the validator/BeanUtils. Thanks! Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Thu, 27 Jan 2005 19:38:44 +0100, PA [EMAIL PROTECTED] wrote: On Jan 27, 2005, at 19:20, Jim Barrows wrote: I'm speaking of frameworks that do a lot of the work for you, which Rails seems to. Hmmm... ok... so when you say that, and under some circumstances, CRUD direct mapping doesn't work you barely implies that direct mapping of database record to what someone calling himself Martin Fowler call Active Record is not a 100% solution as far as your experience goes? http://www.martinfowler.com/eaaCatalog/activeRecord.html Which is what RoR does in its own way: http://wiki.rubyonrails.com/rails/show/ActiveRecord Of course, if you simply forget about record and think in terms of object (ActiveObject perhaps?), all is well in the kingdom, right? Record/Object are sort of the same. A record might have an array as part of it which would be implemented as a seperate table. MIght not. Even then, when you start looking at things as full object graphs, the way you do htem in OO is not the same. Deleting an object from a database is not synonomous with deleting an object from an object graph. If I change a field in an object, I can have side effects as I change the state of the object. Is this an Update? is this an Update with triggers? How do I ripple this change through the database? While all of the quesitons have answers, my point is that they aren't just simple CRUD. Also, I fail to quite see what any of this as to do with either Struts or Tapestry in the first place... does Struts or Tapestry concern themselves directly with such mundane persistency issues? I was under the impression that no, they don't. Did I miss something? Nope neither Struts nor Tapestry do that. Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Jan 27, 2005, at 20:29, Jim Barrows wrote: Record/Object are sort of the same. Hmmm... no. A database row is a database row. Period. The rest is algebra. An object on the other hand is anything your OO implementation language of choice allow you to express. Certainly Create Read Update Delete operations can be applied to both, no? Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:select value=(multiple values)
From: Seaman, Sloan [EMAIL PROTECTED] I'm using struts-html-el.tld and the values that I want to have selected are available as a comma seperated list in ${treatments}. Did you solve this one? I'm not sure if there's an enhancement lurking in here, or not. It seems to me that if html:select ... value=abc is allowed, and html:select ... multiple=true is allowed, then there should be some way to say html:select multiple=true values=abc,123. I don't see that in the Struts taglib, other than the ability to pre-select the items that match a bean property, either the form bean (by default) or the bean specified by html:select name=... -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Are you using Tapestry?
On Thu, 27 Jan 2005 20:38:44 +0100, PA [EMAIL PROTECTED] wrote: On Jan 27, 2005, at 20:29, Jim Barrows wrote: Record/Object are sort of the same. Hmmm... no. A database row is a database row. Period. The rest is algebra. A record is not necessarily a single database row from a single table. Especially in 3NF. An object on the other hand is anything your OO implementation language of choice allow you to express. Certainly Create Read Update Delete operations can be applied to both, no? An object, maybe. Remember an object has the concept of state, and mutators that change the state. While this in a simple form is an update... what if the obejct state has ripple effects? Specifically.. your writing a publishing system. As an article to be published moves through the system it changes states. When an article moves to a Complete state, it notifies listeners that the article is complete and ready to be edited. Strictly CRUD would look at this as change the Article state in the database and the next time a listener scans the database they'll pick up the change. Except that that's not the same as the lisetener firing off an event, in an asynchronous manner. I'm not saying this can't be solved ( JMS, RMI, blah blah), just that it's a place where a CRUD mapping approach falls down. We don't just CRUD data in OO, because an object is also the method that act on it. Cheers -- PA, onnay equitursay http://alt.textdrive.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- James A Barrows - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to Forward out of struts to a URL from an Action
Your action should choose a forward with its redirect attribute set to true: forward name=success redirect=true / Thanks, Paul -Original Message- From: Michael Oliver [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 2:54 PM To: struts-user@jakarta.apache.org Subject: How to Forward out of struts to a URL from an Action I would like to forward the user out of struts to a URL after an action executes without additional user input, what is the best way in Struts? I can use a page that has a redirect javascript in it, but is there a facility in Struts to do this? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [EMAIL PROTECTED] -- Notice: This e-mail message, together with any attachments, contains information of Merck Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to Forward out of struts to a URL from an Action
Hi Michael, have a look in your struts-config.xml. forward name = Success path = /ViewSettings.do redirect = true/ Greets Mark Michael Oliver wrote: I would like to forward the user out of struts to a URL after an action executes without additional user input, what is the best way in Struts? I can use a page that has a redirect javascript in it, but is there a facility in Struts to do this? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How to Forward out of struts to a URL from an Action
Thanks except in your example your forward isn't outside it is to an action in that struts application, I want to go to a URL outside the application, elsewhere on the same server but not to an action or jsp page. I tried Path=/myhtml/somehtml.html and it threw a Configuration Frozen exception. Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 12:11 PM To: Struts Users Mailing List Subject: Re: How to Forward out of struts to a URL from an Action Hi Michael, have a look in your struts-config.xml. forward name = Success path = /ViewSettings.do redirect = true/ Greets Mark Michael Oliver wrote: I would like to forward the user out of struts to a URL after an action executes without additional user input, what is the best way in Struts? I can use a page that has a redirect javascript in it, but is there a facility in Struts to do this? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [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]
Dynamic parameter within html:rewrite
In a form on a JSP I have input text boxes, one with a link beside it that opens a field value selector window. html:text property=userField1 / html:text property=userField2 / a href=javascript:window.open(' html:rewrite page=/promptUserField.do?parent=XXX name=requestform property=udf2Map /'); img src=html:rewrite page='/images/inspect.gif' / /a With the link parameter hard coded as parent=XXX, this works perfectly. However, I need to pass the current value of userField1 as the parent value to the promptUserField action. Basically, instead of parent=XXX, I need parent=document.requestform.userField1.value. Now, this doesn't seem that tough, but I am drawing a huge blank on a solution. Javascript retrieves the current field value, but then what? Is it possible to combine scriptlets and javascript to build that page attribute? I just don't see how. I can put an onchange event in the userField1 tag to update a hidden field or requestform field. But would that help me? I am already passing a map for parameters. I can't tack on another single requestform parameter using the tag attributes that Struts could access automatically. I am not coming up with an idea as to how to put this together. Can someone just point me in the right direction? Thanks, Susan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to Forward out of struts to a URL from an Action
Configure an Action Mapping like so: action path=/test type=com.mycompany.myapp.actions.TestAction forward name=externalForward path=http://www.omnytex.com; redirect=true / /action That's all. If you need it to be a little more dynamic, like I notice you said it was on the same server, if it might be moved from server to server, than get a reference to the forward above in your Action, then construct the path dynamically there before returning it. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, January 27, 2005 3:11 pm, [EMAIL PROTECTED] said: Hi Michael, have a look in your struts-config.xml. forward name = Success path = /ViewSettings.do redirect = true/ Greets Mark Michael Oliver wrote: I would like to forward the user out of struts to a URL after an action executes without additional user input, what is the best way in Struts? I can use a page that has a redirect javascript in it, but is there a facility in Struts to do this? Michael Oliver CTO Alarius Systems LLC 3325 N. Nellis Blvd, #1 Las Vegas, NV 89115 Phone:(702)643-7425 Fax:(520)844-1036 *Note new email changed from [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: Dynamic parameter within html:rewrite
Since a JavaScript function can return any type of value, including a String, why can't you just write a function that returns the value of userField1? Perhaps within the a tag, you could call a function that generates the entire href, using concatenation? Sorry if I'm not understanding the problem correctly. Erik Susan Bradeen wrote: In a form on a JSP I have input text boxes, one with a link beside it that opens a field value selector window. html:text property=userField1 / html:text property=userField2 / a href=javascript:window.open(' html:rewrite page=/promptUserField.do?parent=XXX name=requestform property=udf2Map /'); img src=html:rewrite page='/images/inspect.gif' / /a With the link parameter hard coded as parent=XXX, this works perfectly. However, I need to pass the current value of userField1 as the parent value to the promptUserField action. Basically, instead of parent=XXX, I need parent=document.requestform.userField1.value. Now, this doesn't seem that tough, but I am drawing a huge blank on a solution. Javascript retrieves the current field value, but then what? Is it possible to combine scriptlets and javascript to build that page attribute? I just don't see how. I can put an onchange event in the userField1 tag to update a hidden field or requestform field. But would that help me? I am already passing a map for parameters. I can't tack on another single requestform parameter using the tag attributes that Struts could access automatically. I am not coming up with an idea as to how to put this together. Can someone just point me in the right direction? Thanks, Susan - 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: [Very OT] Hypothetical challege
Hi, there It happens that I'm having this same design problem today :-) (pretty interesting how things matched, huh?!) I totally agree with Wiebe here - his is the only reasonable work-around that i could imagine to this problem. I also thought about serializing the Handle, but i think it won't work because the stateful session with the SFSB could time-out while the web server restarts and until it will get called again. So I cannot see another way, other than persisting the HttpSession data until the same user logs-in again. But, maybe, someone else has another, even more interesting solution... Radu Wiebe de Jong wrote: The simple answer is to store all your session data in a database, with a cookie value as the key. When the client connects, get the cookie value, read the session data from the database, do your stuff, update the database, and respond to the user. This will create a permanent session, which will survive shutting down the browser, web server, app server, and whatever else. The session will only end when the user explicitly logs out and terminates the session. If you don't like the performance hit of going to the database every time, then add a plugin. When the application starts, the plugin will read all the sessions from the database into memory. When the application ends, the plugin would write out all the sessions to the database. Wiebe de Jong -Original Message- From: Chaikin, Yaakov Y. [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:37 PM To: 'Struts Users Mailing List' Subject: [Very OT] Hypothetical challege Hi, This is a hypothetical question, but it's interesting to me if anyone can come up with a solution and what that solution would be. A few facts and requirements: 1) Suppose you have 2 machines. One must serve as your web server and the other must serve as your EJB server. 2) Suppose you must keep track of some sort of session data for each client. How you store the session data is flexible to a point... You want to take advantage of stateful sessions for whatever reason (maybe your EJB server has more resources or something like that). 3) You obviously have a remote reference to your stateful session EJBObject in your web tier. 4) For whatever reason, you anticipate that you will want to restart your web server now and then while there will be some moderate traffic to it going on. Yet, you don't want to make all the clients lose their state. 5) You can use a cookie if you want to remember which client was which when the server restarts. 6) You have the option of storing the remote references to you stateful session EJBObject by getting EJBObject.getHandle() and storing it on the web server machine in a serialized form. 7) No, you can not buy another web server and cluster them! Let's say there is no more money left. How do you catch server/web app shutdown event with no non-portable code, so you can go through all your sessions and save the remote references to your stateful beans on the EJB tier on hard disk so when the server starts back up you would be able to restart the entire app without making the clients lose their state? Yes, this way of a contrived situation, but I am just very interested in how this could be accomplished. Anyone? Thanks, Yaakov. - 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: Dynamic parameter within html:rewrite
From: Susan Bradeen [EMAIL PROTECTED] html:text property=userField1 / html:text property=userField2 / a href=javascript:window.open(' html:rewrite page=/promptUserField.do?parent=XXX name=requestform property=udf2Map /'); With the link parameter hard coded as parent=XXX, this works perfectly. However, I need to pass the current value of userField1 as the parent value to the promptUserField action. Basically, instead of parent=XXX, I need parent=document.requestform.userField1.value. I don't completely understand your example, but it looks like you are trying to feed the results of client-side JavaScript into a server-side JSP tag. You can't, because all the JSP executes on the server, then the HTML goes to the client, and then the JavaScript runs. In other words, at the time the JSP is rendered into HTML, the user has not yet seen the form, so there is nothing in userField1. True? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: errorStyleClass and lists
I've been looking into the BeanUtils isssue, and I've posted details on that bug - see Bug 28358 http://issues.apache.org/bugzilla/show_bug.cgi?id=28358 To summarise, there is a problem in how different versions of the JDK work with indexed properties when you use java.util.List for your indexed properties. However using Arrays doesn't have any issues (as far as I know) and my advice would be (if you don't want to use DynaBeans) is to change your ActionForm to use Arrays rather than java.util.Lists. So your methods for the foos property in your ActionForm would look like: public Foo[] getFoos() public Foo getFoos(int index) public void setFoos(Foo[] foos) public void setFoos(int index, Foo foo) That way you can use consistent property names throughout and the error highlighting should work: In your jsp... c:forEach items=foos id=foos html:text errorStyleClass=fooError name=foos property=day indexed=true / /c:forEach In your validation.xml field indexedListProperty=foos property=day depends=mask Niall - Original Message - From: BLOOMFIELD, TOM F [AG-Contractor/1000] [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, January 27, 2005 7:07 PM Subject: errorStyleClass and lists Per suggestion, I'm posting a follow up to see if anyone on the list has a solution/suggestions to the issue/enhancement below: http://issues.apache.org/bugzilla/show_bug.cgi?id=33258 Summary: To get around the problem with BeanUtils, I have an actionform with the following list structure: List foos; List getFoos() { return foos; } void setFoos(List foos) { this.foos = foos; } Object getFoo(index) { .. initialize list capacity.. return this.foos.get(index); } In my JSP, I iterate over this list and output elements as so: c:forEach items=foos id=foo html:text errorStyleClass=fooError name=foo property=day indexed=true / /c:forEach This works great and gets/sets my list accordingly. All is well. I created a validation for this list: field indexedListProperty=foos property=day depends=mask ... /field This validates my list and puts errors into the global errors with keys that look like this: foos[xxx].day That's fine, it validates, and stores errors. However, since the key it creates, foos[xxx].day is different than the name of my html:text, foo[xxx].day, the errorStyleClass is never used - the two don't match. As pointed out by Niall (see bug link above), I could use a different method name to get/set the list in my actionform. However, doing this causes a BeanUtils error when the page renders (see related bug Niall included). There seem to be a plethora of examples showing how to get/set lists in the manner I posted above, so assume other people have/will have this issue with errorStyleClass. Does anyone have a work around or suggestion for how to fix this without relying on a change to the validator/BeanUtils. Thanks! Tom - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
How to format ActionMessages
Hi ppl, Is there any way to format the messages in ActionMessages? Since theres only a html:messages / to get it, is there any way to make a more complex message formatting? I mean, not only using css. Cya! Thiago Pinheiro Cortex Intelligence Cel +55 21 9685-1089 Tel +55 21 3114-1801 Fax +55 21 3114-1805 HYPERLINK http://www.cortex-intelligence.com/www.cortex-intelligence.com --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.808 / Virus Database: 550 - Release Date: 8/12/2004
RE: [Very OT] Hypothetical challege
Wow! And I really was just making this up... Although you have a valid point about the session timing out, it's not 100% in context. Here is what I mean... Sessions time out because it is assumed after a certain amount of time that the client will not come back. Persisting your temp session data to the database kind of jumps over that business rule and says that clients can come back after ANY time passes. If that's what you wanted to begin with - fine. But all you are trying to do is prevent a server restart from destroying a user's session, then sticking it into the database is really a strange thing to do, i.e., you are changing the original behavior just to satisfy this requirement... The point is to in fact let the client lose the session after the same amount of time he would have lost it in the first place. (Not sure if there is an equivalent in EJBs to servlets' setSessionTimeout(), but I would assume that there is.) So, all you should really do (taking original business logic into account) is increase your session time out by the amount of time it takes to restart. Preferably you should do it as your web app ends so it will still have the default session time out the rest of the time. You could easily do this in contextDestroyed() in (ServletContextListener) and reset it back in contextInitialized(). So, now the only question that remain is how do you capture every session handle that's out there serialize it for later use... Well, how about keeping a HashMap in ServletContext scope with a key that would match the session cookie and the remote handle as the object? In ServletContextListener.contextDestroyed() serialize the entire HashMap with the handles. In ServletContextListener.contextInitialized(), deserialize the HashMap with the handles. Now, when the client comes in, check if he has sessionID cookie and see if it's in your HashMap. You know the rest... One caveat would be that you would have to build something to make the HashMap expire session keys and their values once the session gets destroyed. Hmm... but how would you do that??? There might not be a solution that would make it virtually invisible that the sever got restarted... Partially, I am still unclear how the servlet's session ID get propagated to the EJB session ID. Are they the same? I don't know... More research is needed. Of course, all this is very theoretical and I was only originally asking to drill down to the lowest level of this and understand what's possible. Even if this were possible, I would still go with persisting the session ID in the database... Otherwise, this is starting to look too much like a hack instead of an elegant solution, which is what I was after in the first place. Yaakov. -Original Message- From: Radu Badita [mailto:[EMAIL PROTECTED] Sent: Thursday, January 27, 2005 4:42 PM To: Struts Users Mailing List Subject: Re: [Very OT] Hypothetical challege Hi, there It happens that I'm having this same design problem today :-) (pretty interesting how things matched, huh?!) I totally agree with Wiebe here - his is the only reasonable work-around that i could imagine to this problem. I also thought about serializing the Handle, but i think it won't work because the stateful session with the SFSB could time-out while the web server restarts and until it will get called again. So I cannot see another way, other than persisting the HttpSession data until the same user logs-in again. But, maybe, someone else has another, even more interesting solution... Radu Wiebe de Jong wrote: The simple answer is to store all your session data in a database, with a cookie value as the key. When the client connects, get the cookie value, read the session data from the database, do your stuff, update the database, and respond to the user. This will create a permanent session, which will survive shutting down the browser, web server, app server, and whatever else. The session will only end when the user explicitly logs out and terminates the session. If you don't like the performance hit of going to the database every time, then add a plugin. When the application starts, the plugin will read all the sessions from the database into memory. When the application ends, the plugin would write out all the sessions to the database. Wiebe de Jong -Original Message- From: Chaikin, Yaakov Y. [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:37 PM To: 'Struts Users Mailing List' Subject: [Very OT] Hypothetical challege Hi, This is a hypothetical question, but it's interesting to me if anyone can come up with a solution and what that solution would be. A few facts and requirements: 1) Suppose you have 2 machines. One must serve as your web server and the other must serve as your EJB server. 2) Suppose you must keep track of some sort of session data for each client. How you store the session data is flexible to a point... You want to take advantage of stateful sessions for whatever
Problem using logic:equal and logic:notEqual
I'm trying to determine which block of HTML to output. This is on a page that will be included by many different forms. logic:equal property=stateSelection value=SELSTATE span id=selectBox style=display:block; /logic:equal logic:notEqual property=stateSelection value=SELSTATE span id=selectBox style=display:none; /logic:notEqual Anybody have a suggestion? Here is the beginning of the exception: javax.servlet.jsp.JspException: No selector attribute (cookie/header/name/parameter) was specified 18:23:07,500 ERROR [Engine] StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception at org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:205) at org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:46) at org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagBase.java:174) at org.apache.jsp.tag.web.location_tag._jspx_meth_logic_equal_0(location_tag.java:216) javax.servlet.jsp.JspException: No selector attribute (cookie/header/name/parameter) was specified = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PlugIn and the base URL
Martin Wegner wrote: In have a Struts PlugIn that needs to determine the URL for the containing web application (http://localhost:8080/BlahBlahBlah/). Martin, since you seem firm on this issue, can we/I ask WHY you need this information in your webapp during initialization? What are you doing that you cannot set that information per request (HTTP/SOAP) in your output? (Or use relative URLS of some sort) Knowing WHY, perhaps someone on the list can suggest an alternate, yet equally effective, solution for the issue. Regards, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Welcome file problem
I am restricting *.jsp in web.xml. ActionServlet is mapped to /foo/*. I would like to use a welcome file so that a URL of http://host:port/app will resolve to the index page. However, the index page is a JSP, so it's not accessible directly. So basically what I need is a welcome file that actually resolves to an unprotected Action mapping. Something like this: welcome-file-list welcome-file/foo/index.html/welcome-file /welcome-file-list . . . action-mappings action path=/index.html forward=/index.jsp/ /action-mappings How can I accomplish this (assuming no Apache Web Server in front)? Thanks, Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using logic:equal and logic:notEqual
I was missing name. I was a little leary, because the form name would depend on which form I was included on at the time. I changed the file to a tag file and sent the form name as a parameter. This worked perfectly: logic:equal name=${formName} property=stateSelection value=SELSTATE span id=selectBox style=display:block; /logic:equal logic:notEqual name=${formName} property=stateSelection value=SELSTATE span id=selectBox style=display:none; /logic:notEqual Thx for your help. --- Wendy Smoak [EMAIL PROTECTED] wrote: From: Norris Shelton [EMAIL PROTECTED] I'm trying to determine which block of HTML to output. This is on a page that will be included by many different forms. logic:equal property=stateSelection value=SELSTATE span id=selectBox style=display:block; /logic:equal logic:notEqual property=stateSelection value=SELSTATE span id=selectBox style=display:none; /logic:notEqual javax.servlet.jsp.JspException: No selector attribute (cookie/header/name/parameter) was specified http://struts.apache.org/userGuide/struts-logic.html#equal Your logic:equal tag is missing an attribute, either cookie, header, name, or parameter. Given that you're using 'property', you need to tell it the 'name' of the bean that has this property. (Logic tags do not default to an enclosing html:form bean the way the html tags do.) How about span id=selectBox style=display:c:out value=${selstate}/ -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] = Norris Shelton Software Engineer Sun Certified Java 1.1 Programmer Appriss, Inc. ICQ# 26487421 AIM NorrisEShelton YIM norrisshelton __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PlugIn and the base URL
David, I do not mean to speak for Martin, but my guess is that he might want to send SOAP prior to a request. He might even have to send and to receive SOAP prior to a request.I know that this is why I often need to do this sort of thing. Jack On Thu, 27 Jan 2005 18:50:08 -0500, David G. Friedman [EMAIL PROTECTED] wrote: Martin Wegner wrote: In have a Struts PlugIn that needs to determine the URL for the containing web application (http://localhost:8080/BlahBlahBlah/). Martin, since you seem firm on this issue, can we/I ask WHY you need this information in your webapp during initialization? What are you doing that you cannot set that information per request (HTTP/SOAP) in your output? (Or use relative URLS of some sort) Knowing WHY, perhaps someone on the list can suggest an alternate, yet equally effective, solution for the issue. Regards, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PlugIn and the base URL
I think it is important to remember that the URL is a detail that is wholly independent of the application or the machine. This is an external device for the benefit of human beings whom do not do as well with numbers as with letters in the memonic department. Therefore, I don't think that this is a problem within AXIS? Right? Jack On Wed, 26 Jan 2005 09:53:26 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: Agreed. That approach works more often than not. Except in this case. The client of the WS does indeed use the URL that is sent back. That is part of the overal protocol. So it has to be a valid URL that reaches the WS inside of my Struts app. One could argue that the real problem is within Axis, which does not provide any HTTP details to the WS call dispatcher. If I had access to that info I could stuff it into the WS DOM response and not bother with the Struts PlugIn. Sigh. --Marty --- Varley, Roger [EMAIL PROTECTED] wrote: The WS response has to contain the URL that was used to access the WS. This is a requirement of the XML Schema that defines the WS response payload. I have no control over this. I know this might be stupid, but whenever I see an odd requirement like this my first experiment is to see what happens if I pass something that is a valid URL but doesn't actually point anywhere. In this way you could simply hard-code a string value into your plugin. It wouldn't be the first time I've come across a mandatory requirement that doesn't actually do anything :) Regards Roger __ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. __ - 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] -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:form action getting altered after validation
Hi all, I have a fairly simple form like so: html:form action=/someProcess.do html:text property=username / /html:form When the input fails validation and the user is sent back to the form the action is changed to //someProcess.do - is this familiar to anyone? What am I missing? This is with struts 1.2.4 -- Stephen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Welcome file problem
On Thu, 27 Jan 2005 18:54:26 -0500, Erik Weber [EMAIL PROTECTED] wrote: I am restricting *.jsp in web.xml. ActionServlet is mapped to /foo/*. I would like to use a welcome file so that a URL of http://host:port/app will resolve to the index page. However, the index page is a JSP, so it's not accessible directly. So basically what I need is a welcome file that actually resolves to an unprotected Action mapping. Something like this: welcome-file-list welcome-file/foo/index.html/welcome-file /welcome-file-list . . . action-mappings action path=/index.html forward=/index.jsp/ /action-mappings How can I accomplish this (assuming no Apache Web Server in front)? What you have setup should work except that if the welcome-file is not an actual file, then the server will issue a 404. The work around is to have a dummy index.html file inside foo folder (for your setup, it's foo/index.html) so that the server is happy and it tries to serve foo/index.html but the request is instead served by the ActionServlet (/foo/*) and your /index.jsp will be shown. Note that the welcome-file should not start or end with a /. Making your welcome-file to foo/index.html and have a dummy index.html inside foo folder should work Thanks, Erik - 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: Welcome file problem
Kishore, thanks a lot for your help. Interestingly, the problem was only that I had /foo/index.html instead of foo/index.html as my welcome file entry. After I removed the beginning forward slash as you suggested, it worked (without the need for the dummy file -- I did not encounter the 404). This is with Tomcat 5.0.27. Thanks again, Erik Kishore Senji wrote: On Thu, 27 Jan 2005 18:54:26 -0500, Erik Weber [EMAIL PROTECTED] wrote: I am restricting *.jsp in web.xml. ActionServlet is mapped to /foo/*. I would like to use a welcome file so that a URL of http://host:port/app will resolve to the index page. However, the index page is a JSP, so it's not accessible directly. So basically what I need is a welcome file that actually resolves to an unprotected Action mapping. Something like this: welcome-file-list welcome-file/foo/index.html/welcome-file /welcome-file-list . . . action-mappings action path=/index.html forward=/index.jsp/ /action-mappings How can I accomplish this (assuming no Apache Web Server in front)? What you have setup should work except that if the welcome-file is not an actual file, then the server will issue a 404. The work around is to have a dummy index.html file inside foo folder (for your setup, it's foo/index.html) so that the server is happy and it tries to serve foo/index.html but the request is instead served by the ActionServlet (/foo/*) and your /index.jsp will be shown. Note that the welcome-file should not start or end with a /. Making your welcome-file to foo/index.html and have a dummy index.html inside foo folder should work Thanks, Erik - 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: html:form action getting altered after validation
On Fri, 28 Jan 2005 13:22:32 +1300, Stephen Souness [EMAIL PROTECTED] wrote: Hi all, I have a fairly simple form like so: html:form action=/someProcess.do html:text property=username / /html:form When the input fails validation and the user is sent back to the form the action is changed to //someProcess.do - is this familiar to anyone? What am I missing? If I had to take a wild guess, I think you have declared your struts-config.xml with a param-name config/ instead of just config (Note the no slash) which lets Struts create two modules one with prefix (empty string) and another with a prefix (/) which I guess causes the // problem. If you have infact declared it as config/ then removing the slash should solve the problem. This is with struts 1.2.4 -- Stephen - 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: html:form action getting altered after validation
Did a little more digging around and found a bugzilla entry - fixed in 1.2.6 (beta) http://issues.apache.org/bugzilla/show_bug.cgi?id=32283 -- Stephen Kishore Senji wrote: On Fri, 28 Jan 2005 13:22:32 +1300, Stephen Souness [EMAIL PROTECTED] wrote: Hi all, I have a fairly simple form like so: html:form action=/someProcess.do html:text property=username / /html:form When the input fails validation and the user is sent back to the form the action is changed to //someProcess.do - is this familiar to anyone? What am I missing? If I had to take a wild guess, I think you have declared your struts-config.xml with a param-name config/ instead of just config (Note the no slash) which lets Struts create two modules one with prefix (empty string) and another with a prefix (/) which I guess causes the // problem. If you have infact declared it as config/ then removing the slash should solve the problem. This is with struts 1.2.4 -- Stephen - 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: error and warning messages
Title: RE: error and warning messages Yes andy, you can define as a validate=true in your struts-config.xml mapping. Cheers Sunil -Original Message- From: Andy Richards [mailto:[EMAIL PROTECTED]] Sent: Monday, January 24, 2005 8:43 PM To: Jim Barrows Cc: Struts Users Mailing List Subject: Re: error and warning messages Thanks Jim, this was along the lines off what i was thinking. Can i not just say validate=true in my struts config for my error validation, or must i call super.validate from my action form before i do my warning logic? cheers Andy Jim Barrows wrote: On Mon, 24 Jan 2005 13:34:50 +, Andy Richards [EMAIL PROTECTED] wrote: Hi I have the requirement to perform server side validation on a form, no probs. The problem is that i have a set of error rules and a set of warning rules. There is no problem defining the errors in my validation.xml and returning the user to the page to correct them, however at some point probably when all error messages have been validated i need to show warning messages. For example value X is outside of the normal range do you want to continue? If not i want the user to be able to change their value, however this then means i need to do the error checking again incase the user has changed there warning value to an error value!! I thought of the idea of having error rules in my validation.xml and then dynamically validating the warning rules progmatically in my action (not sure if this is the best method though). Has anyone come across a solution or able to think of a better method of implementing this functionality. Struts, I believe, has no real mechanism for warnings, so your going to have to put that into the session yourself. I think the better place would be in the validation method of your form. Make sure you call super.validate. Any errors it returns will be errors, then you can check for warnings, putting those messages into your warning attribute. Many thanks Andy - 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 message is intended solely for the individual or entity to # # which it is addressed.This communication may contain information# # that is proprietary,privileged or confidential and otherwise legally# # exempt from disclosure. If you are not the named addressee, or have # # been inadvertently referenced in the address line, you are not # # authorized to read, print, retain, copy or disseminate this message # # any part of it. If you have received this message in error , please # # notify the sender immediately by e-mail and delete all copies of# # the message.# ### - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] a java question
Title: RE: [OT] a java question No Problem ashish, you can do one thing, don't initialize it, only declare the variable as final and assign the value at run time but you can assign Only one time means subsequent attempts to assign a value to a Final variable result in a compiler error. Simply declare the local variable and initialize it later, like this: final int intVar; . . . intVar = 0; cheers Sunil -Original Message- From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 27, 2005 12:38 AM To: user@struts.apache.org Subject: [OT] a java question Hi If we need a variable which can be accessed from any class, then we set this variable as static and access it as MyClass.Variable, this variable can be modified from any class if we dont set this variable as final like public static final String Variable = ABC; here is the problem, i cannot set this variable as final as the value is set at run time bu the initalization class, how do i protect it from updated by any other class. Ashish = A$HI$H __ Do you Yahoo!? The all-new My Yahoo! - What will yours do? http://my.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ### # This message is intended solely for the individual or entity to # # which it is addressed.This communication may contain information# # that is proprietary,privileged or confidential and otherwise legally# # exempt from disclosure. If you are not the named addressee, or have # # been inadvertently referenced in the address line, you are not # # authorized to read, print, retain, copy or disseminate this message # # any part of it. If you have received this message in error , please # # notify the sender immediately by e-mail and delete all copies of# # the message.# ### - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: WEB-INF and non-JSP files
snip On Thu, 27 Jan 2005 18:51:35 -0600, Will Stranathan [EMAIL PROTECTED] wrote: If I remember the same thread, I think the thrust of the argument was that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT web artifacts. However, images and javascripts, unless you have a custom servlet or Struts action to retrieve those artifacts, would NOT belong under WEB-INF - those are specific to presentation. /snip Where you put the files, Will, has little, I think, to do with any architecture. Rather, the issue is accessibility. If you want only programmatic accessibility, you want to do something to ensure that a URL cannot reach your assets. These assets can be anything: images, a phone book, JSP pages, etc. I put everything there. No reason not to in my case. Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Process tiles definition from a different module
On Thu, 27 Jan 2005 13:54:26 +0100, Diego Manilla Suárez [EMAIL PROTECTED] wrote: Hi! I need to process a tiles definition that is located in a different module. I have this ActionForward declared on the module I want to invoke: forward name=myPage path=.myTilesDefinition redirect=false/ And on the main module, I have this code (in an action) to get that forward definition. ActionForward forward = null; ServletContext context = getServlet().getServletContext(); ModuleConfig config = ModuleUtils.getInstance().getModuleConfig(othermodule, context); if (config != null org.apache.struts.action.ActionForward.equals(config.getActionForwardClass())) { forward = (ActionForward)config.findForwardConfig(myPage); } return forward; This doesn't work because Tiles is not processing the definition .myTilesDefinition (I have two separate Tiles definition configurations, one for each module). How can I get the definition on the other module processed by Tiles? I know I can import the definitions of the second module using set-property property=definitions-config ... in struts-config.xml, but I'm wondering if it's possible to do what I want without this trick. With TilesUtilStrutsModulesImpl class I get the DefinitionsFactory object for the second module, but I can't get past there. Doesn't seem to be possible with the default TilesProcessor because the DefinitionsFactory is tied to an instance of TilesProcessor and once such processor exists for each module and the TilesProcessor only looks up for the definitions in the DefinitionsFactory that it has in it's instance. So, if your TilesProcessor is processing a request in one module and if you want to forward to another module's tile definition, the current module's TilesProcessor wouldn't be able to find your tile definition. * By subclassing TilesProcessor and overriding processTilesDefinitions() method to look for definitions for all the modules would be one solution * If it's only a simple set of forwards which are common across modules, then listing them in all modules might not be a bad solution Thanks in advance. - 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: WEB-INF and non-JSP files
Will, That sounds right. Thanks for the summation. --Marty --- Will Stranathan [EMAIL PROTECTED] wrote: If I remember the same thread, I think the thrust of the argument was that JSP belongs under WEB-INF because it's TEMPLATE artifacts, NOT web artifacts. However, images and javascripts, unless you have a custom servlet or Struts action to retrieve those artifacts, would NOT belong under WEB-INF - those are specific to presentation. w On Wed, 26 Jan 2005 21:59:53 -0800 (PST) Martin Wegner [EMAIL PROTECTED] wrote: I recently saw a post about moving all web app files underneath the WEB-INF directory. Unfortunately the search mechanism on the Struts web site appears to be unavailable and I can't find those emails. So I understand why some would put Javascript, JSP, images, etc. under WEB-INF. But if you do that, how do you access it? What is the Struts trick to get the container to send non-JSP files underneath WEB-INF? --Marty - 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: PlugIn and the base URL
David, As I said in a previous message my Struts app has an Axis-based SOAP service. The business logic behind the WS needs to know a/the URL that can be used to access the WS. This is a requirement of the WS. This part can't be changed. It is part of the protocol of the answer sent back by the WS. So the question becomes: if the web container, port number, IP address(es) and WAR file name can all cahnge, how does the Struts PlugIn figure out a/the URL to access the WS? As stated earlier, if a human were to log in then the Request object would contain all of the necessary info. But the PlugIn does not have a Request object. So the question becomes: what is the trick to get the PlugIn to generate a Request object? Clearly you could use something like HttpClient to make an HTTP call back to the main app, but how do you construct the URL at run time? You can't contact yourself unless you make at least a few assumptions. And I can't make those in this case. The other good answer was to force the user to supply the URL via an external file or via an installer. That is the solution I have adopted for the time being. --Marty --- David G. Friedman [EMAIL PROTECTED] wrote: Martin Wegner wrote: In have a Struts PlugIn that needs to determine the URL for the containing web application (http://localhost:8080/BlahBlahBlah/). Martin, since you seem firm on this issue, can we/I ask WHY you need this information in your webapp during initialization? What are you doing that you cannot set that information per request (HTTP/SOAP) in your output? (Or use relative URLS of some sort) Knowing WHY, perhaps someone on the list can suggest an alternate, yet equally effective, solution for the issue. Regards, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: PlugIn and the base URL
David, Also, as I said early the Axis architecture is such that it does not provide any of the information related to the HTTP layer beneath SOAP. The only think you know is that your dispatcher gets called. So my problem may be considered a limitation in Axis. --Marty Martin, since you seem firm on this issue, can we/I ask WHY you need this information in your webapp during initialization? What are you doing that you cannot set that information per request (HTTP/SOAP) in your output? (Or use relative URLS of some sort) Knowing WHY, perhaps someone on the list can suggest an alternate, yet equally effective, solution for the issue. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts, XHTML, DOCTYPES, and EL (several newbie questions)
Okay I am new to struts (around a week) and having made a couple of little test apps am moving towards validation and w3c compliance. I am using 1.2.4 for what it is worth in Netbeans 4.0. There appears two methods of enabling html compliance with struts. The first is html:html xhtml=true which adds the xmlns info. The second is via html:xhmtl / which is closed so I guess I don't need it if I have xhtml=true in my opening tags. Or do I? Documentation suggests that without the html:xhtml / then the output will be to html 4.x (no closed tags etc.). I am correct in assuming this? Code doesn't seem changed either way but then again my JSP is well formed to begin with. Also there doesn't appear to be a doctype tag in struts. Is there one in the JSTL? I have done a search but haven't found an answer. It seems to be rather obvious to me that since every file will be reduced to (x)html and by w3c standards a (x)html file must have a DOCTYPE that a tag would be present. However I haven't found one. Also what version of the struts should I be using? The standard struts or the el version? From what I can make out it would appear the EL version will be the 1.3 release with a lot of the Struts/JSTL overlap removed and a new parser?. Would it be better to use the EL version over the regular version? On the Netbeans front (I know this isn't the place for it but I hope someone can help) the documentation that appears when selecting the tags doesn't have any description of what the tags do. Where is this information locally or should I download the src to get the documentation? I'd rather have a local copy than use the public one on sao/api/. Thanks for your time, Graham Reeds. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: PlugIn and the base URL
On Thu, 27 Jan 2005 21:17:07 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: David, Also, as I said early the Axis architecture is such that it does not provide any of the information related to the HTTP layer beneath SOAP. The only think you know is that your dispatcher gets called. So my problem may be considered a limitation in Axis. Assuming that all your web service requests to Axis contains /axis in the path for eg(http://company.com/axis/WebService.jws), I guess you could have a Filter for the url-pattern /axis/* whose job is to take the path that was requested (eg http://company.com/axis/WebService.jws) and stick it into your business objects? Essentially having a Filter instead of a Plugin. So, when a web service is requested, before the request reaches the AxisServlet, the Filter would save the URL in the business objects and your business objects can throw that URL into the response. Wouldn't this work? --Marty Martin, since you seem firm on this issue, can we/I ask WHY you need this information in your webapp during initialization? What are you doing that you cannot set that information per request (HTTP/SOAP) in your output? (Or use relative URLS of some sort) Knowing WHY, perhaps someone on the list can suggest an alternate, yet equally effective, solution for the issue. - 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]
Fwd: PlugIn and the base URL
-- Forwarded message -- From: Dakota Jack [EMAIL PROTECTED] Date: Thu, 27 Jan 2005 22:24:00 -0800 Subject: Re: PlugIn and the base URL To: Martin Wegner [EMAIL PROTECTED] snip On Thu, 27 Jan 2005 21:25:11 -0800 (PST), Martin Wegner [EMAIL PROTECTED] wrote: Jack, How do you have the PlugIn call into the Struts app? How do you craft the URL? /snip As you know, the URL has to be converted into an IP address anyway. So, since people are out of the loop, we will just start with one. First, have the PlugIn call a foreign or outside machine with a request of its own. This can be done, for example, with something like the messaging classes with Jason Hunter's cos jar at http://servlets.com/cos/ and check out HttpMessage and HttpsMessage to get an idea of what you can do. Send the foreign machne a message with the needed information such as the port number, and whatever. When the foreign machine gets your message, have it extract your IP address and message it back to you via message by adding the port and other information as needed. This will be returned to the PlugIn. Getting this return message, you now have everything you need for the SOAP protocol in URL terms, i.e. http://[ip address from the foriegn host]/port/whatever. Set the information and you are set to go. Understand? You are actually just writing a little Java browser for you own purposes inside the PlugIn. Jack -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. -- -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ You can't wake a person who is pretending to be asleep. ~Native Proverb~ Each man is good in His sight. It is not necessary for eagles to be crows. ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ --- This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]