UML
I am trying to represent, in a UML class diagram, a certain architecture. How would one represent an object, that is placed into session scope.? The object is used by Action clasess. I kinda want to use the composition relation, but the object really isn't a property of the object itself. -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UML
In the composition case, I think it would be Action MyObject because the Action contains the object. But my question is should I use the composition relation here, or something else? -Trav Yansheng Lin wrote: I think it's Action---YourObject ??? -Original Message- From: Travis Stevens [mailto:[EMAIL PROTECTED] Sent: August 26, 2003 9:31 AM To: Struts Users Mailing List Subject: UML I am trying to represent, in a UML class diagram, a certain architecture. How would one represent an object, that is placed into session scope.? The object is used by Action clasess. I kinda want to use the composition relation, but the object really isn't a property of the object itself. -Trav - 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: relative links and the html:base tag
Use the html:link / tag. This will take care of everything for you. -Trav Fumo, Vince wrote: I'm using the html:base tag in all my jsps so my images and css sheets get correctly referenced. However, when I add refs to my action mappings, I have to add a ../ before them for them to work. For example A HREF=help.do will get me the follwing error: The request sent by the client was syntactically incorrect (Invalid path /pages/help was requested). Hoever, if I use A HREF=../help.do things work as expected. Fyi, the mapping is as follows: action path =/help type=org.apache.struts.actions.ForwardAction parameter=/pages/help.jsp/ I would like to write my jsps without having to preface all the hrefs. Is there a simple way to deal with this problem? dir stucture is as follows app |- pages |- images |- common help.jsp other.jsp's |- WEB-INF |- classes |- lib struts-config.xml etc... - 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]
flow question
To reach a goal, I need many different actions. One is to select a record, then choose elements in that record and so on. The select a record actions has actions within itself. Display search criteria, display results. Is it acceptable to have a single action as a controller, delegating request to each sub action, or is better to go sequentially from one action to another. I guess the problem with a single action, is that one can only use one type of ActionForm. Any other thoughts on this? -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
ForwardAction and modules
I have a module in which I have a forward action, and it seems that I have to add the module name to the parameter of the forward page. (actual example) action path=/adminIndex parameter=/admin/adminIndex.jsp type=org.apache.struts.actions.ForwardAction / I would think that the ForwardAction should take into consideration that the forward page is in the specified module: (envisioned example) action path=/adminIndex parameter=/adminIndex.jsp type=org.apache.struts.actions.ForwardAction / In my example there is an admin module and a file: /admin/adminIndex.jsp. Any thoughts on this? -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
authentication
I need some help with authentication with struts. I have been looking into filter validation, having a directory /publicAction and a directory /privateAction each containing public and private actions. The interesting thing, if the action mapping is /privateAction/* and /publicAction/*, then two two different urls can acccess someAction, both /privateAction/someAction and /publicAction/someAction. I could have two directories, one /action/public and the other action/private. But here, the mapping would be action/*, and the struts-config.xml paths would have to me something like: path=/private/privateAction, which seems a little messy, especially if a privateAction is to become a public action. Any ideas? I can't use container managed authentication. any help would be great! -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
modules, somethings missing
I am doing something wrong with modules, and am not quite sure what. Basically, the rui requested is always being routed to default. Here are my settings: web.xml: servlet servlet-nameNmmrActionServlet/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/conf/nmmr-struts-config.xml/param-value /init-param init-param param-nameconfig/public/param-name param-value/WEB-INF/conf/public-struts-config.xml/param-value /init-param init-param param-nameconfig/private/param-name param-value/WEB-INF/conf/private-struts-config.xml/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/nmmr/*/url-pattern /servlet-mapping servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/public/*/url-pattern /servlet-mapping servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/private/*/url-pattern /servlet-mapping When I request a url of: context/public/someAction i get this: Thread-4 DEBUG util.RequestUtils - Get module name for path /private Thread-4 DEBUG util.RequestUtils - Module name found: default any ideas? thanks, -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: modules, somethings missing
If you wanted you could the URL mapping for *.cool or something and you will see Struts append that to your path. That way people would not know you are using Struts (maybe to fake out hackers). G I think i'll us a *.asp, althought that would probably not deter hackers very much. -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: modules, somethings missing
I cna't say that I really understand why my way didn't work. I really don't see a problem with having multiple mappings to an ActionServlet, at least on the tomcat side of things. Now that I think about it, struts accesses the web.xml file for some configuration information, maybe struts itself only looks for one action mapping when it does its internal configuration. Anyhow, I changed the mapping to *.do and everything works great, thanks Shane! -Trav Bailey, Shane C. wrote: I believe the problem is that you can only have 1 URL mapping to the Struts Servlet. All you have to have is your first servlet-mapping. Struts will then take care of everything automatically from then on out. The thing you will have to keep in mind is that if you are in the main module to access you link to module actions by doing html:link action=/public/someAction and html:link action=/private/someAction or if you want to go to an action with the same name in the main module you just do html:link action=someAction One you have linked to the desired action and JSPs served up by those modules will then be accessed like such html:link action=someAction but Struts will automatically figure you are in a JSP served by, say, private so it makes the URL whatever.com/nmmr/private/someAction. When you are in say the public module (meaning in a JSP which was served up by an action within that module) and you want to get to a private modules action then you do something like this: public module struts config: global-forward forward name=privateHome contextRelative=true path=/private/privateHomeAction/ /global-forward then inside a public module JSP you would link to the private area by doing html:link forward=privateHomePrivate Home/html:link To be honest with you I use the .do instead of /do/* (meaning like your /nmmr/ prefix) so that part is kinda sketchy with me as to when you need to add /nmmr to the front of the action link etc. But you should get the idea I hope. -Original Message- From: Travis Stevens [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 5:08 PM To: [EMAIL PROTECTED] Subject: modules, somethings missing I am doing something wrong with modules, and am not quite sure what. Basically, the rui requested is always being routed to default. Here are my settings: web.xml: servlet servlet-nameNmmrActionServlet/servlet-name servlet-classorg.apache.struts.action.ActionServlet/servlet-class init-param param-nameconfig/param-name param-value/WEB-INF/conf/nmmr-struts-config.xml/param-value /init-param init-param param-nameconfig/public/param-name param-value/WEB-INF/conf/public-struts-config.xml/param-value /init-param init-param param-nameconfig/private/param-name param-value/WEB-INF/conf/private-struts-config.xml/param-value /init-param load-on-startup2/load-on-startup /servlet servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/nmmr/*/url-pattern /servlet-mapping servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/public/*/url-pattern /servlet-mapping servlet-mapping servlet-nameNmmrActionServlet/servlet-name url-pattern/private/*/url-pattern /servlet-mapping When I request a url of: context/public/someAction i get this: Thread-4 DEBUG util.RequestUtils - Get module name for path /private Thread-4 DEBUG util.RequestUtils - Module name found: default any ideas? thanks, -Trav - 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]
Design Question
Hello, I have some functionality in my web application that allows a user to select a record. This functionality is plugged into other types of functions, such as combine a record or select a component record. Steps to combine a record: 1. select a record 2. configure combining 3. combine Sets to selct a compont 1. select a record 2. set the record as a component. As you can see, the select a record functionality is common. To implement this I would like to create action classes specifically for the select a record interface. One of the request parameters would be the action to forward the result to. The GET request would look something like this: /action/selectRecord?recordSetName=namefinishedForwardAction=/action/combineRecord This would: 1. display search fields 2. search / display results 3. redirect to the finishedForwardActionPage (would it be better to put the record in the session for the finshedForwardAction or just pass the id as a parameter) Is this an acceptable implementation, or is there a better way? -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design Question
Because the foward action should be completely dinamic. The select action should know nothing concrete about any of the actions that use the functionality, otherwise one would have to edit the select action every time a new action is created that uses the select action. [EMAIL PROTECTED] wrote: Why not just define the forward action in the selectRecord action mapping element in your struts-config.xml? shane Quoting Erik Price [EMAIL PROTECTED]: Travis Stevens wrote: As you can see, the select a record functionality is common. To implement this I would like to create action classes specifically for the select a record interface. One of the request parameters would be the action to forward the result to. The GET request would look something like this: /action/selectRecord? recordSetName=namefinishedForwardAction=/action/combineRecord This would: 1. display search fields 2. search / display results 3. redirect to the finishedForwardActionPage (would it be better to put the record in the session for the finshedForwardAction or just pass the id as a parameter) Is this an acceptable implementation, or is there a better way? I'm not saying that this is a better way, but it strikes me that selecting a record might not be something that you want to confine to Struts Actions -- for instance, someday down the road you might want to select a record from some other interface or even as a service from another application. You might wish to abstract this even further than the level of Action, and make (for instance) a [POJO] class, such as RecordSelector, that performs this activity. Then you can create Actions specific to your form interfaces, and when it is necessary to select a record, you can use this class to do the work (delegating the information from the Action to the class). This is known as the Command design pattern (in fact Struts Actions are themselves an implementation of the Command design pattern, but they are tightly coupled to the servlet framework). http://www.dofactory.com/Patterns/PatternCommand.aspx This may also spare you the process of supplying a parameter to indicate which Action this should ultimately be forwarded to, since you would just have the form submit to that Action and delegate the work to RecordSelector from inside of that Action. Just a suggestion. Erik - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This mail sent through Toaster-Horde (http://qmailtoaster.clikka.com/) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
messages 101
I can't seem to get messages to work. My action code has this line of code: //create a message ActionMessages messages = new ActionMessages(); messages.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage(record.save.success,new Integer(record.getUID(; this.saveMessages(request,messages); //log it if (log.isInfoEnabled()){ log.info(Record saved successfully: + record.getUID()); } and my view has this: html:messages id=error bean:write name=error/br / /html:messages and my struts-config has: message-resources parameter=gov.noaa.mm.NMMRResources/ Nothing prints out in my view. What am I missing here? The log message Record saved successfully shows up, so I know that the messages are being saved. My ActionErrors work fine so I know my message-resources are being used properly. The javadoc for Action.saveMessages() reads: Save the specified messages keys into the appropriate request attribute for use by the html:messages tag (if messages=true is set), if any messages are required. Is this my problem? Do I have to set messages to true. Where do I set messages=true? thanks, -Trav - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Using XMLForms in Struts
This is something that I could use too. I can see an XMLActionForm class as well as an XMLDynaActionForm class. Both of these would create org.w3c.doc.Document objects based on the input form. I work with metadata, specifically FGDC metadata. There is an XML representation of FGDC. For example, the value of a title of a metadata record goes into: idinfociteinfocitationtitle and a browse graphic goes into idinfobrowsebrowsen Our forms are created dynamically using the XML structure and it would be great to be able to do this: FGDCIdinfo idinfoForm = (FGDCIdinfo) actionForm; Document fgdcDocument = idinfoForm.getDocument(); FGDCRecord record = session.getAttribute(record_being_edited); record.updateRecord(fgdcDocument); Might be an interesting project to take on. -Trav Simon Kelly wrote: It's input from html, using xml, and allows you to create a forms that are more complex in nature than is normally handled by html forms. I'm just starting with it myself, so I'm not all up to speed on exactly how it works. - Original Message - From: Adam Hardy [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Thursday, July 24, 2003 4:44 PM Subject: Re: Using XMLForms in Struts Hi Simon, what is xml forms? Do you use it to produce xml output? Is it for input as well? Adam Simon Kelly wrote: Hi all, has anyone tried to use the XMLForms in the struts setup yet? I need to use it as part of the pre-requisites for the current project, and am wondering if it is easy or complex to get it to run along side the struts framework. Any help appreciated as usual. Cheers Simon I have often wondered how it is that every man loves himself more than all the rest of men, but yet sets less value on his own opinion of himself than on the opinion of others. -- Georg Christoph Lichtenberg Institut fuer Prozessdatenverarbeitung und Elektronik, Forschungszentrum Karlsruhe GmbH, Postfach 3640, D-76021 Karlsruhe, Germany. Tel: (+49)/7247 82-4042 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]