Re: [OT] : javascript revival?
Andrew Hill wrote: snip/ IMHO you would be better served spending your time providing support for the lynx browser... LOL - ROFL ... Andrew, you made my night with that one!! I'm not saying you're wrong - I'm just saying I nearly busted a gut! (*) Possible underexageration. The real figure is closer to 6. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts and state information
Web server can use three mechanisms to store the sessionid. 1. The SSL session id 2. The session id stored in a cooke 3. URL rewriting like you describe If you configure your web server to have persistent sessions it should be able to share the session in a load balancing scenario. If you use cookies to store all your state information you could ignore HttpSessions all together. There may also be an elegant way to use a filter to save and restore session state from the cookie. The performance hit of persistent sessions is something to keep in mind. Corneil du Plessis Technical Specialist Internet Development Retail Channels Standard Bank Direct +27 (11) 636-2210 Mobile +27 (83) 442-9221 ICQ# 66747137 -Original Message- From: Brett Elliott [mailto:[EMAIL PROTECTED]] Sent: 14 October, 2002 07:07 To: [EMAIL PROTECTED] Subject: Struts and state information I would like to keep session state soley in cookies so I can use round robin HTTP load balancing versus sticky load balancing(sticky load balancing as in all requests are directed at a specific web server for a given user. I read Professional JSP, perused this mailing list and looked on the web and nothing really elaborates on where the state is stored by default. I see how the html:link /html:link directive is translated into a href=http://...;jsessionid=X/a but where does it get X and where does it store the session information related to X? Does it rely on the jsession ID being passed around in URLs then keep the associated session information cached on the server? So if you have multiple servers you will need to use sticky load balancing to make sure users only use one webserver? What options are there in case I want to keep all session state in cookies? That is, ideally, I would generate an encrypted cookie w/ CRC containing the logged in username and minimal information about the user. And I would like to do this within the confines of Struts. Thanks for any help and I aplogize if this is a redundant question. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relating to the official business of Standard Bank Group Limited is proprietary to the company. It is confidential, legally privileged and protected by law. Standard Bank does not own and endorse any other content. Views and opinions are those of the sender unless clearly stated as being that of Standard Bank. The person addressed in the e-mail is the sole authorised recipient. Please notify the sender immediately if it has unintentionally reached you and do not read, disclose or use the content in any way. Standard Bank can not assure that the integrity of this communication has been maintained nor that it is free of errors, virus, interception or interference. __ -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: tiles problem with findForward
Hi, I suspect that the Tiles definition factory is not properly initialized. The initialization has changed between Struts1.0 and struts1.1b2, to follow the new struts request processing. You need now a TilesRequestProcessor which is set by the TilesPlugin. You don't need the ComponentActionServlet anymore. Check http://jakarta.apache.org/struts/userGuide/dev_tiles.html. Cedric Cagan Senturk wrote: Hi, I am running struts-1.1-b2 on Weblogic 7, and am getting 404-Page not found as result of the following code: TileDefinitions.xml: tiles-definitions definition name=firstPageBaseDef path=/p3/layout/firstPageLayout.jsp some put elements here /definition !-- Portal First Page -- definition name=portalFirst extends=firstPageBaseDef some put elements here /definition /tiles-definitions Action mapping section in struts-config.xml: action-mappings action path=/p3/index type=com.emirca.pp.controller.actionhandler.GreetAction validate=false forward name=success path=portalFirst/ /action /action-mappings And the Action class (GreetAction) tries the following: public ActionForward perform(ActionMapping actionMapping, ActionForm form, HttpServletRequest req, HttpServletResponse res){ return actionMapping.findForward(success); } I checked that findForward(success) finds the ActionForward with path = portalFirst But even though 'portalFirst' is defined in TileDefinitions.xml, i'm getting a 404-Page Not Found Error. When I replace the portalFirst with a jsp that exists, like path=/p3/jsp/index.jsp, that works The same code was working fine with struts1.0.2 (with tiles.jar)...I just started having this problem after I switched to struts-1.1b2.. I'd appreciate any help on this... Thanks, Cagan Senturk Emirca Technologies, Inc. 75 Spring St. 8th Floor NYC, NY 10012 tel (917) 237 2937 fax (212) 343 7446 [EMAIL PROTECTED] http://www.emirca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Tiles - Forward problem
I have overridden the TilesREquestProcessor in order to test if a user is authenticated for each request, but it doesn't work: protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { // Get the session object HttpSession session = request.getSession(); try{ // Test if the request is a login request String path = processPath(request, response); if ( !path.equals((String) /login) ) { // If not a login page, test if the user is authenticated on the application server User userInfo = (User)session.getAttribute(Constants.USER_KEY); if ( userInfo == null || (userInfo != null userInfo.getSessionId() == 0) ) { processActionForward(request, response, (ActionForward)appConfig.findForwardConfig(login)); } } } // if a servlet exception occurs catch (ServletException ex) { } //if an input/output error occurs catch (IOException ex) { } return true; } With the following login forward: forward name=login path=/login.do / action path=/login name=LoginForm validate=true type=com.Actions.LoginAction input=site.login.page scope=request forward name=success path=site.mainLayout / /action The following error is displayed: java.lang.IllegalArgumentException: Path does not start with a / character -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: When *exactly* does reset get called?
On 12 Oct 2002 at 10:25, David M. Karr wrote: From the original description, it sounds like your reset method is using business logic to get data values to populate your fields with. From Antoni's explanation of how reset is used, I hope it's clear that won't work very well. The ActionForm.reset() method should only be used to CLEAR form values, before they are populated from the request. You should use business logic in your Action class to populate form beans. That is exactly my problem. How can an Action class populate a form bean before the form bean is created? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: bean:write data containing html tag?
I would recommend preprocessing your content. You would then need to choose filter=false in bean:write. This means that the br tags aren't made safe by substituting html reserved chars with safe equivalents thus giving you lt;brgt; chanoch - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, recipients should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 04:39 To: Struts Users Mailing List Subject: RE: bean:write data containing html tag? Oops. Just tried it out and indeed it does give one long line :-( I had been under the (wrong) impression that it would wrap as well as respect tabs and newlines etc... Only other thing I can think of (which I dont recommend as its inelegant) would be to process the data before outputting it and insert '\n' at appropriate positions in the long string, still using a pre block to output. -Original Message- From: Walter Fu [mailto:[EMAIL PROTECTED]] Sent: Friday, October 11, 2002 23:51 To: Struts Users Mailing List Subject: RE: bean:write data containing html tag? If a pre block is used, the condition as stated in 1 would not be satisfied: there will be no text wrap within a pre and the original paragraph comes out as a single wide line. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Thursday, October 10, 2002 7:57 PM To: Struts Users Mailing List Subject: RE: bean:write data containing html tag? Surround your output (bean:write...) with pre and /pre which tells the browser to render it as preformatted text , and will respect spaces, newlines, tabs etc... This is also very useful if you need to show an exception stack trace in the browser. Note that within a PRE block, not all html elements can be used (shouldnt be an issue in this particular case though as you just want to display that fields contents). -Original Message- From: Walter Fu [mailto:[EMAIL PROTECTED]] Sent: Friday, October 11, 2002 07:16 To: '[EMAIL PROTECTED]' Subject: bean:write data containing html tag? This might be a problem that people have already seen and solved: html:textarea is used for the user to enter data. 1. A single line of data may be so long that textarea wraps it around automatically. So it looks to the user as one paragraph. 2. There can be many new lines ( \n ) in the data when the user hits the Enter key. Once the data is captured as a String property, it can be shown to the user on a subsequent page correctly in a textarea. If on the subsequent page I wish to use not a textarea (not even with the readonly attribute) but something like bean:write to echo the data, how do I preserve the \n in 2? The browser would auto-wrap the text correctly. So that satisfies 1. The \n of course is treated by the browser as a single space. So the original paragraphs in 2 are lost. One possibility is to replace \n with br/ in the data. When I did that, the br/ came out as lt;br/gt; This is not what I wanted. Any suggestions? Thanks, Walter -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles and tabbed display
Hi, You are right that the actual code doesn't works well if you use an action URL instead of a jsp URL. The solution is to not set the page URI at all when computing the tabs href. Like this, the browser use the original URL. To do this, simply replace the offending line by: // compute href String href = ?+parameterName + = + index; Cedric Peterkofsky, Don wrote: Cedric - I've been using Struts/Tiles to implement a tabbed display page, and in general it works very nicely. However, I think there is an oversight in the tabsLayout example, which will cause a problem in use. This has to do with how the href is calculated for the links in the tabs. In the iteration through the tabsList, this code is setting the href for each tab: // compute href String href = request.getRequestURI() + ?+parameterName + = + index; By doing this, we will end up with a link to the jsp file of the tabbed display page, which we don't want, rather than a link to the action that calls the jsp, which is what we do want. By doing it the way it is done in the tabsLayout.jsp, the links from the tabs will not go through an action and will not go through the Struts controller, and therefore won't be able to process the Tiles. For example, what we want to see in a tab href is: http://localhost:8080/wctemplates/tabstemplate.do?tab=1 However, what we do see is: http://localhost:8080/wctemplates/tabsLayout.jsp?tab=1 What needs to happen, is for each tab href to be a link that is made up of the action name, i.e./servlet/tabAction.do?selected=1. Have you experienced this issue, or had any previous inquiries about this? What are your thoughts? Thanks, Don Peterkofsky -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Struts and state information
Cookies is default for jsp containers, jsp only goes to session ids if it cant get a hold of the cookies. X is automatically generated by the container if a session is requested, either directly by calling request.getSession() or by configuring the specific jsp page for sessions. I think html:link and forms automatically pass session ids and there isnt anything you can do about it. Anyoen care to correct me? chanoch - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, recipients should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments. -Original Message- From: Brett Elliott [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 06:07 To: [EMAIL PROTECTED] Subject: Struts and state information I would like to keep session state soley in cookies so I can use round robin HTTP load balancing versus sticky load balancing(sticky load balancing as in all requests are directed at a specific web server for a given user. I read Professional JSP, perused this mailing list and looked on the web and nothing really elaborates on where the state is stored by default. I see how the html:link /html:link directive is translated into a href=http://...;jsessionid=X/a but where does it get X and where does it store the session information related to X? Does it rely on the jsession ID being passed around in URLs then keep the associated session information cached on the server? So if you have multiple servers you will need to use sticky load balancing to make sure users only use one webserver? What options are there in case I want to keep all session state in cookies? That is, ideally, I would generate an encrypted cookie w/ CRC containing the logged in username and minimal information about the user. And I would like to do this within the confines of Struts. Thanks for any help and I aplogize if this is a redundant question. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: When *exactly* does reset get called?
This is execution path (is that correct term?): Identify the path to select mapping, Set the locale Set the content-type and non caching headers Preprocess Identify mapping Check if a role is required to perform the action Retrieve or create the form and store in scope Call reset() Populate the form *** called here. So the bean is created when its populated, let me reassure you:) Its still much better to put business logic somewhere else than your reset method. chanoch - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, recipients should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments. -Original Message- From: Markus Herrmann [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 10:29 To: [EMAIL PROTECTED] Subject: Re: When *exactly* does reset get called? On 12 Oct 2002 at 10:25, David M. Karr wrote: From the original description, it sounds like your reset method is using business logic to get data values to populate your fields with. From Antoni's explanation of how reset is used, I hope it's clear that won't work very well. The ActionForm.reset() method should only be used to CLEAR form values, before they are populated from the request. You should use business logic in your Action class to populate form beans. That is exactly my problem. How can an Action class populate a form bean before the form bean is created? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[OT] What is package commons-services.jar
Does anybody can explain me in few word what is package commons-services.jar ? Thx, -emmanuel ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [OT] What is package commons-services.jar
I think it allows you to discover system services and java classes - probably using some kind of naming convention that the service then translates to the actual resource chanoch - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, recipients should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments. -Original Message- From: Emmanuel Boudrant [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 11:51 To: [EMAIL PROTECTED] Subject: [OT] What is package commons-services.jar Does anybody can explain me in few word what is package commons-services.jar ? Thx, -emmanuel ___ Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français ! Yahoo! Mail : http://fr.mail.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] : javascript revival?
Gemes Tibor wrote: Konqueror ... doesn't. I'm sorry - I run KDE, but there's a *reason* I Since version 3.0 it's OK imho. Sorry to say - it's 3.0.0-12 I'm running :-/ and it seems deficient to me. I can do all things, unhindered in Mozilla, whereas there were some sites which flat did not work under Konqueror. I can't remember now which specific funcational areas I found lacking. I'll have to look again when I get a chance so I can be more conversant about it. Sorry :-) but I respectfully disagree. Tib -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] : javascript revival?
Sorry to say - it's 3.0.0-12 I'm running :-/ and it seems deficient to me. I can do all things, unhindered in Mozilla, whereas there were some sites which flat did not work under Konqueror. I can't remember now which specific funcational areas I found lacking. I'll have to look again when I get a chance so I can be more conversant about it. I use both mozilla and konqueror for development, and if a page works on these two, I have to test almost none on the other browsers. There are few sites that do not work with konqueror. But it renders a far better looking page if it is able to display it. This is the most important reason why I use it. Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
The best practices regarding secure JSP and Action classes
I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? _ Introducing the all new and improved continental.com. With a totally new personalized design, it's the best place to go. Before you go. Continental Airlines. Work Hard. Fly Right. http://www.continental.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] : javascript revival?
Gemes Tibor wrote: Sorry to say - it's 3.0.0-12 I'm running :-/ and it seems deficient to me. I can do all things, unhindered in Mozilla, whereas there were some sites which flat did not work under Konqueror. I can't remember now which specific funcational areas I found lacking. I'll have to look again when I get a chance so I can be more conversant about it. I use both mozilla and konqueror for development, and if a page works on these two, I have to test almost none on the other browsers. There are few sites that do not work with konqueror. But it renders a far better looking page if it is able to display it. This is the most important reason why I use it. Huh - whataya know. Ok - well, I'll play with it then. You've peaked my curiosity. I'll toy with it. Which browsers do you build against? ... and what functional areas do you find you still have to test in other browsers? I haven't even considered it something worthy of my time to use - but, if you are correct, I am very mistaken. Thanks for the tip :-) I'll give it another try. It's conceivable the sites I hit with it just weren't up-to-par. Tib -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles - Forward problem
Hi, A Dilluns 14 Octubre 2002 10:59, Heligon Sandra va escriure: I have overridden the TilesREquestProcessor in order to test if a user is authenticated for each request, but it doesn't work: protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { // Get the session object HttpSession session = request.getSession(); try{ // Test if the request is a login request String path = processPath(request, response); if ( !path.equals((String) /login) ) { // If not a login page, test if the user is authenticated on the application server User userInfo = (User)session.getAttribute(Constants.USER_KEY); if ( userInfo == null || (userInfo != null userInfo.getSessionId() == 0) ) { Change this: processActionForward(request, response, (ActionForward)appConfig.findForwardConfig(login)); for this: processForwardConfig(request, response, appConfig.findForwardConfig(login)); } } } // if a servlet exception occurs catch (ServletException ex) { } //if an input/output error occurs catch (IOException ex) { } return true; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: The best practices regarding secure JSP and Action classes
Using sessions? Have you used servlet roles before? chanoch - The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer. Although we routinely screen for viruses, recipients should check this e-mail and any attachment for viruses. We make no warranty as to absence of viruses in this e-mail or any attachments. -Original Message- From: Hoang, Hai [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 15:23 To: 'struts-user' Subject: The best practices regarding secure JSP and Action classes I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? _ Introducing the all new and improved continental.com. With a totally new personalized design, it's the best place to go. Before you go. Continental Airlines. Work Hard. Fly Right. http://www.continental.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Struts Tag to insert URI?
I don't want to hard code the URI into my JSP pages on where the JSP page should post back to. Does struts have a tag that I can insert into my JSP page so struts will insert the URI that was requested for this page -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: The best practices regarding secure JSP and Action classes
- setup container-managed authentication - as a server-configured service - as a filter (see securityfilter.sourceforge.net) - see your servlet container user guide for setup of non-filter-based solution - in your web.xml - declare the roles you will use - declare the URLs etc - see the servlet specification for how to configure this The web.xml config applies to the non-filter-based approach I *think*. See the filter's site for more information on how to configure that particular one. If you push your authentication/authorization up to the server level, you don't have to have nasty hacks in all of your protected JSPs. Just make the auth work and specify the mappings it holds true for. Other good references on this topic include Java Servlet Programming (Jason Hunter - O'Reilly) and Java Server Pages (Hans Bergsten - O'Reilly). There are probably other resources available that outline how to configure your deployment descriptor (web.xml) for this. Hoang, Hai wrote: I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tiles - Forward problem
I only have to not cast the result of the findForwardConfig method ? Sandra -Original Message- From: Antoni Reus [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 16:39 To: Struts Users Mailing List Subject: Re: Tiles - Forward problem Hi, A Dilluns 14 Octubre 2002 10:59, Heligon Sandra va escriure: I have overridden the TilesREquestProcessor in order to test if a user is authenticated for each request, but it doesn't work: protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { // Get the session object HttpSession session = request.getSession(); try{ // Test if the request is a login request String path = processPath(request, response); if ( !path.equals((String) /login) ) { // If not a login page, test if the user is authenticated on the application server User userInfo = (User)session.getAttribute(Constants.USER_KEY); if ( userInfo == null || (userInfo != null userInfo.getSessionId() == 0) ) { Change this: processActionForward(request, response, (ActionForward)appConfig.findForwardConfig(login)); for this: processForwardConfig(request, response, appConfig.findForwardConfig(login)); } } } // if a servlet exception occurs catch (ServletException ex) { } //if an input/output error occurs catch (IOException ex) { } return true; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
DAO or ... ?
My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: The best practices regarding secure JSP and Action classes
I already have my own database driven security model. Once a user logon I already know his role. But the problem is that how do I make this security model to work with the container-managed model so I don't have to check every on single page. Hai -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:38 AM To: Struts Users Mailing List Subject: Re: The best practices regarding secure JSP and Action classes - setup container-managed authentication - as a server-configured service - as a filter (see securityfilter.sourceforge.net) - see your servlet container user guide for setup of non-filter-based solution - in your web.xml - declare the roles you will use - declare the URLs etc - see the servlet specification for how to configure this The web.xml config applies to the non-filter-based approach I *think*. See the filter's site for more information on how to configure that particular one. If you push your authentication/authorization up to the server level, you don't have to have nasty hacks in all of your protected JSPs. Just make the auth work and specify the mappings it holds true for. Other good references on this topic include Java Servlet Programming (Jason Hunter - O'Reilly) and Java Server Pages (Hans Bergsten - O'Reilly). There are probably other resources available that outline how to configure your deployment descriptor (web.xml) for this. Hoang, Hai wrote: I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Introducing the all new and improved continental.com. With a totally new personalized design, it's the best place to go. Before you go. Continental Airlines. Work Hard. Fly Right. http://www.continental.com
RE: DAO or ... ?
Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
repeating input fields
I know this has been asked before but I'm unable to find anything in the archive - probably not using the right search terms... I'm trying to create a form that allows the user to input a list of strings. Kind of like a detail block (of a master-detail relationship). So I have public class LoanPurpose { private String id; private String description; public String getId() {return id;} public void setId( String v ) { id = v; } public String getDescription() {return description;} public void setDescription( String v ) {description = v;} } and a Form bean public class LoansForm extends ActionForm { private LoansPurpose[] purposes = null; public LoanPurpose[] getPurposes() {return purposes;} public void setPurposes( LoanPurpose[] v ) {purposes = v;} public void reset(ActionMapping mapping, HttpServletRequest request) {purposes = null;} } In my JSP form I have: html:form action=/saveLoanPurps method=post table logic:iterate id=p name=LoansForm property=purposes trtd html:text name=p property=id size=15/ /tdtd bean:write name=p property=description filter=true/ /td/tr /logic:iterate /table html:submitSave/html:submit /html:form If I stuff a few values into the purposes array in the edit action they properly get displayed when the form is rendered. This is where I get lost though. When I hit the Save submit button I don't get the results I expect. In the Save action I print the contents of the LoansForm.purposes array and it is null, instead of having the contents of the input fields. What am I missing? Any help would be most appreciated. Thanks, Kevin. __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DAO or ... ?
Avoid persistence in Action code as much as you can. Yes. And a way to do that is to say in action something like: formBean.save() where the formBean has something like this in save() {getDAO().update()} and the DAo does the save for the bean. .V Lacerda, Wellington (AFIS) wrote: Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: The best practices regarding secure JSP and Action classes
Just use security-constraint in your web.xml deployment descriptor. For example: security-constraint web-resource-collection web-resource-name Private resources /web-resource-name url-pattern /private /url-pattern /web-resource-collection auth-constraint role-namemember/role-name /auth-constraint user-data-constraint transport-guarantee NONE /transport-guarantee /user-data-constraint /security-constraint The above will make all pages/actions/anything in app/private require a logon. You will also have to tell web.xml what type of logon to use. -AP_ http://www.myprofiles.com/member/profile/apara_personal -Original Message- From: Hoang, Hai [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 7:44 AM To: 'Struts Users Mailing List' Subject: RE: The best practices regarding secure JSP and Action classes I already have my own database driven security model. Once a user logon I already know his role. But the problem is that how do I make this security model to work with the container-managed model so I don't have to check every on single page. Hai -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:38 AM To: Struts Users Mailing List Subject: Re: The best practices regarding secure JSP and Action classes - setup container-managed authentication - as a server-configured service - as a filter (see securityfilter.sourceforge.net) - see your servlet container user guide for setup of non-filter-based solution - in your web.xml - declare the roles you will use - declare the URLs etc - see the servlet specification for how to configure this The web.xml config applies to the non-filter-based approach I *think*. See the filter's site for more information on how to configure that particular one. If you push your authentication/authorization up to the server level, you don't have to have nasty hacks in all of your protected JSPs. Just make the auth work and specify the mappings it holds true for. Other good references on this topic include Java Servlet Programming (Jason Hunter - O'Reilly) and Java Server Pages (Hans Bergsten - O'Reilly). There are probably other resources available that outline how to configure your deployment descriptor (web.xml) for this. Hoang, Hai wrote: I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Introducing the all new and improved continental.com. With a totally new personalized design, it's the best place to go. Before you go. Continental Airlines. Work Hard. Fly Right. http://www.continental.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: [OT] : javascript revival?
2002. október 14. 16:31 dátummal Eddie Bush ezt írtad: Which browsers do you build against? ... and what functional areas do you find you still have to test in other browsers? I haven't even I meant IE. Actually unlike most webdevelopers I know I do not use IE during the devel period. considered it something worthy of my time to use - but, if you are correct, I am very mistaken. Nope, you're right. I am forced to use some nasty dhtml scripting which I would avoid if I could. On every release time I have reboot, test with IE, just run through NS and opera, but I dislike the last 2 as a matter of fact. Thanks for the tip :-) I'll give it another try. It's conceivable the sites I hit with it just weren't up-to-par. Actually the milosic.com menu does not work w/ konqueror, the www.mattkruse.com dhtml calendar popup does not work w/ konqueror etc etc But it was far worse before the version 3.0 Tib -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: The best practices regarding secure JSP and Action classes
It's not a question of making your model work with CMA. You would use one or the other. Most likely (unless you have odd needs), the functionality provided by CMA will suffice to meet your goals. Once you have CMA setup there is *one* hit to authenticate the user - and that information is then maintained by the server and is available through *standard* methods (which your database-driven scheme cannot boast, I think) which will allow Struts to be selective about which options it gives the user (if you configure it to do so). CMA just does it. It will check when a protected resource is requested and see if the user is authenticated. If they are not - boom - they have to authenticate. You no longer have to check on every page. Checking on every page is (IMHO) a hack. Please go read up on Container-Managed Authentication. Either grab a copy of the servlet spec or search the web. There is a lot of general information about it. For information about configuring it with *your* servlet container, see your container's handbook (user guide). If you're using Tomcat, and you can access your database via JDBC, check out JDBCRealm. If you don't think that's a good fit you might check out Max Cooper's (I think that's his name) project on SourceForge - the project is securityfilter, I think. Hoang, Hai wrote: I already have my own database driven security model. Once a user logon I already know his role. But the problem is that how do I make this security model to work with the container-managed model so I don't have to check every on single page. Hai -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DAO or ... ?
Le lun 14/10/2002 à 16:55, V. Cekvenich a écrit : Avoid persistence in Action code as much as you can. Yes. And a way to do that is to say in action something like: formBean.save() where the formBean has something like this in save() {getDAO().update()} and the DAo does the save for the bean. But I'v read that the domain objects needn't know that are persitent, if you implement a save method that means that ur object know it can be persisted .V Lacerda, Wellington (AFIS) wrote: Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: The best practices regarding secure JSP and Action classes
Use JDBC relms that read your db. Hoang, Hai wrote: I already have my own database driven security model. Once a user logon I already know his role. But the problem is that how do I make this security model to work with the container-managed model so I don't have to check every on single page. Hai -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:38 AM To: Struts Users Mailing List Subject: Re: The best practices regarding secure JSP and Action classes - setup container-managed authentication - as a server-configured service - as a filter (see securityfilter.sourceforge.net) - see your servlet container user guide for setup of non-filter-based solution - in your web.xml - declare the roles you will use - declare the URLs etc - see the servlet specification for how to configure this The web.xml config applies to the non-filter-based approach I *think*. See the filter's site for more information on how to configure that particular one. If you push your authentication/authorization up to the server level, you don't have to have nasty hacks in all of your protected JSPs. Just make the auth work and specify the mappings it holds true for. Other good references on this topic include Java Servlet Programming (Jason Hunter - O'Reilly) and Java Server Pages (Hans Bergsten - O'Reilly). There are probably other resources available that outline how to configure your deployment descriptor (web.xml) for this. Hoang, Hai wrote: I want to secure the admin portion of my application from unauthorized users. What is the best way to achieve this task? Should I include a CheckUser tag on every jsp pages and call a CheckUser function on every single action class? I don't want the user to just key in the direct url of the jsp page or calling the action class directly. But doing this, I've to go to the database twice on every action. Do you know a better way? -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: repeating input fields
What you are doing is fine for layout, however, when you hit save how is struts supposed to know that id is supposed to map to LoanForm.purposes[??].id, or that descriptions maps to LoanForm.purposes[??].description. It does not, so nothing is set in to your array. You must emit your properties with all the information that struts can use to put them back into the form when it's submitted. For example: instead of: property=id property=description use: property=purposes[1].id property=purposes[1].description How you put the index into the property does not matter. You can use the indexed attribute on some fields and use the index that can be gathered from the iterator tag. For example, here is a form that has an array of files: logic:iterate id=file name=multiPictureCreateForm property=files indexId=count tr td valign=top align=right class=formLabel%=count.intValue()+1%:/td td valign=top align=left class=formEntry html:file size=75 property=%=files[ + count + ]% /br /td /tr /logic:iterate This should get you started... -AP_ http://www.myprofiles.com/member/profile/apara_personal -Original Message- From: Kevin HaleBoyes [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 7:54 AM To: [EMAIL PROTECTED] Subject: repeating input fields I know this has been asked before but I'm unable to find anything in the archive - probably not using the right search terms... I'm trying to create a form that allows the user to input a list of strings. Kind of like a detail block (of a master-detail relationship). So I have public class LoanPurpose { private String id; private String description; public String getId() {return id;} public void setId( String v ) { id = v; } public String getDescription() {return description;} public void setDescription( String v ) {description = v;} } and a Form bean public class LoansForm extends ActionForm { private LoansPurpose[] purposes = null; public LoanPurpose[] getPurposes() {return purposes;} public void setPurposes( LoanPurpose[] v ) {purposes = v;} public void reset(ActionMapping mapping, HttpServletRequest request) {purposes = null;} } In my JSP form I have: html:form action=/saveLoanPurps method=post table logic:iterate id=p name=LoansForm property=purposes trtd html:text name=p property=id size=15/ /tdtd bean:write name=p property=description filter=true/ /td/tr /logic:iterate /table html:submitSave/html:submit /html:form If I stuff a few values into the purposes array in the edit action they properly get displayed when the form is rendered. This is where I get lost though. When I hit the Save submit button I don't get the results I expect. In the Save action I print the contents of the LoansForm.purposes array and it is null, instead of having the contents of the input fields. What am I missing? Any help would be most appreciated. Thanks, Kevin. __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
Dont know that I like the idea of tying the form bean to the persistance layer so tightly. (Although admitedly my own formbeans know a wee bit more than they ought to about the persistance stuff!) -Original Message- From: news [mailto:[EMAIL PROTECTED]]On Behalf Of V. Cekvenich Sent: Monday, October 14, 2002 22:55 To: [EMAIL PROTECTED] Subject: Re: DAO or ... ? Avoid persistence in Action code as much as you can. Yes. And a way to do that is to say in action something like: formBean.save() where the formBean has something like this in save() {getDAO().update()} and the DAo does the save for the bean. .V Lacerda, Wellington (AFIS) wrote: Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); But I'v read that the domain objects needn't know that are persitent, if you implement a save method that means that ur object know it can be persisted In that example, the domainObject still doesn't have to know if/how it's being persisted. I've implemented the whole DAO pattern, excepting the last bit that makes it easy to switch databases since it's highly unlikely that will happen here. In 'EditContactAction' I have: DAOFactory udFactory = DAOFactory.getDAOFactory(); ContactDAO contactDAO = udFactory.getContactDAO(); Contact contact = contactDAO.createContact(); Later, in 'ProcessContactAction' there's: contactDAO.updateContact( contact ); So while the Actions know that persistence is happening, they have no idea how it occurs. -- Wendy Smoak http://sourceforge.net/projects/unidbtags
Re: [OT] : javascript revival?
Gemes Tibor wrote: 2002. október 14. 16:31 dátummal Eddie Bush ezt írtad: Which browsers do you build against? ... and what functional areas do you find you still have to test in other browsers? I haven't even I meant IE. Actually unlike most webdevelopers I know I do not use IE during the devel period. I typically make it work in Mozilla and go from there :-) I should probably use something else during dvel though, as Mozilla and I agree a lot better on how things should work than do NS/IE/Etc. I've not seen Mozilla fail to render a page that rendered well in the others, but I *have* seen the others fail to render a page that rendered well in Mozilla. considered it something worthy of my time to use - but, if you are correct, I am very mistaken. Nope, you're right. I am forced to use some nasty dhtml scripting which I would avoid if I could. On every release time I have reboot, test with IE, just run through NS and opera, but I dislike the last 2 as a matter of fact. Well I have no good reason for not testing more on IE - I've got a Linux/Windows workstation configured on a KVM switch - just double-tap the Ctl key and I'm looking at Windoze. That machine doesn't get started up much though ;-) Thanks for the tip :-) I'll give it another try. It's conceivable the sites I hit with it just weren't up-to-par. Actually the milosic.com menu does not work w/ konqueror, the www.mattkruse.com dhtml calendar popup does not work w/ konqueror etc etc Ah ok - that's probably what my problems came from. But it was far worse before the version 3.0 I don't think I tried it before :-) Tib Ok - well, thanks for the info :-) I'll keep an eye on it as a possible second test under Linux. Maybe I'll eventually get to where I don't have to fire up Windoze at all! ;-) A lot of things come down to structural layout though - so I'll see how handy I find it for that. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
Le lun 14/10/2002 à 17:10, Wendy Smoak a écrit : PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); But I'v read that the domain objects needn't know that are persitent, if you implement a save method that means that ur object know it can be persisted In that example, the domainObject still doesn't have to know if/how it's being persisted. I've implemented the whole DAO pattern, excepting the last bit that makes it easy to switch databases since it's highly unlikely that will happen here. In 'EditContactAction' I have: DAOFactory udFactory = DAOFactory.getDAOFactory(); ContactDAO contactDAO = udFactory.getContactDAO(); Contact contact = contactDAO.createContact(); Later, in 'ProcessContactAction' there's: contactDAO.updateContact( contact ); So while the Actions know that persistence is happening, they have no idea how it occurs. so domainObject doesn't know about the DAO existence, and DAO's represent ur persistence layer that is called into the struts action. so if I can implement a generic DAO (that workd for all domain objects) i will have GenericDAO gd = // obtain a reference Contact contact = session.getAttribute(contact); gd.update(contact); -- Wendy Smoak http://sourceforge.net/projects/unidbtags -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
Andrew, -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Yes. In fact, we only ever communicate from the Actions to the Core code via the API. This gives us wonderfully straight-forward actions (extract data from form, call appropriate API method, load form with returned data). The actions in our application are the conduits between Struts and our core code. Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) Yoda might say: Everything a layer is. The problem is not that something is or is not a layer, but is it useful and does the extra abstraction help or hinder?! In our project we found the concept of a solid API to work wonderfully for us. YMMV. :-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... I'd say that you'd want at least two layers between V and P. How about V - C - M - P. We have a couple of sub-layers in the M and P layers as well. We split some of the core code facilities into sub-systems, to facilitate converting them to services at a later date. Every system is different and has unique constraints. Ours, had the risk that they would take Struts away from us, so we HAD to be interface agnostic. In the end they approved Struts (with some muttering and grumbling ... well, lots of muttering actually :-), so we had no interface rework, but it was a VERY real possibility for the first 50% of the project. Under such circumstances, layers are your friend! Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
I cannot seem to be able to ost to the list.
Can somebody check it out please ? (If this goes through of'course) I did reply to number of messages, but it never got it into the list neither to the archive on www.mail-archive.com Jf -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: I cannot seem to be able to ost to the list.
We got that one! James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org -Original Message- From: Jan Fetyko [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:26 AM To: struts Subject: I cannot seem to be able to ost to the list. Can somebody check it out please ? (If this goes through of'course) I did reply to number of messages, but it never got it into the list neither to the archive on www.mail-archive.com Jf -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Best practices using value objects
Best practices using value objects I still have questions regarding best practices, the use value object and of the beanutil package. How would you convert a value object to a form bean if a property of the VO is a list of other object that would need to be converted to a form? Here is an example of what I am trying to do. I have value objects coming from the business tier. VOSchool String address Vector students VOStudent String name int status boolean isPresident Vector courses I have a page with a lists of all students names, a radio button to indicate if he is the president and a checkbox that changed the status is selected. I think I need a StudentForm with all the info from the VO plus a boolean isSelected property. My SchoolForm need all info from the VO plus a president property. - How can I best reuse by VOs? - Should I add a property to the VOs? How? - Are the forms dynamic forms? - Should I copy all attributes form the VO to a form? - Do I need to write a converter for all my VOs, VO to form and form to VO? I think it is a very common problem but I was not able to find a pretty solution nor an example on how to do this. Thanks Stephan
Re: I cannot seem to be able to ost to the list.
Sometimes it's just slow. Check your Sent folder to make sure you actually sent the message, and make sure you don't receive anything from the MAILER-DAEMON saying it bounced. If those two things are true then most likely it's just taking a while to be shown. I have this happen a lot lately :-( but I'm not sure if it's just me or not - part of the time I think it is. Jan Fetyko wrote: Can somebody check it out please ? (If this goes through of'course) I did reply to number of messages, but it never got it into the list neither to the archive on www.mail-archive.com Jf -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Validator XML error in logs
I have setup my struts application to use the StrutsValidator Plugin. As directed, the validator-rules.xml file looks something like : --- ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE form-validation PUBLIC -//Apache Software Foundation//DTD Struts Validation Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/validation_1_1.dtd; form-validation global ... /global formset /formset /form-validation --- When I start my TomCat 4.1.12, I see the following error message in the log : --- [INFO] PropertyMessageResources - -Initializing, config='org.apache.struts.actio n.ActionResources', returnNull=true [INFO] PropertyMessageResources - -Initializing, config='ApplicationResources', returnNull=true [INFO] ValidatorPlugIn - -Loading validation rules file from '/WEB-INF/validator -rules.xml' org.xml.sax.SAXParseException: Document root element definition, must match DO CTYPE root null. at java.lang.Throwable.fillInStackTrace(Native Method) at java.lang.Throwable.fillInStackTrace(Compiled Code) at java.lang.Throwable.init(Compiled Code) at java.lang.Exception.init(Compiled Code) at org.xml.sax.SAXException.init(SAXException.java:78) at org.xml.sax.SAXParseException.init(SAXParseException.java:147) at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Er rorHandlerWrapper.java:232) at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper. .. --- Can somebody let me know what I need to do to avoid this. Thanks, Nizar Bhamani CONFIDENTIALITY This e-mail and any attachments are confidential and also may be privileged. If you are not the named recipient, or have otherwise received this communication in error, please delete it from your inbox, notify the sender immediately, and do not disclose its contents to any other person, use them for any purpose, or store or copy them in any medium. Thank you for your cooperation. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: [ANNOUNCE] struts-layout 1.0b1
First of all, great job! This looks like a very useful extension. I tried to download and compile it and ran into trouble with the struts-menu package. I tried to download the struts-menu package from http://husted.com/struts/resources/struts-menu.zip but it is old and refers to org.apache.struts.digester. After fixing that, struts-layout still does not compile with it because MenuComponent doesn't have get/setPage and get/setForward as struts-layout requires. Where can I get the source of a working package? Tal Lev-Ami Trivnet Ltd. -Original Message- From: Jean-Noel Ribette [mailto:[EMAIL PROTECTED]] Sent: Wednesday, October 09, 2002 6:16 PM To: Struts Users Mailing List Subject: Re: [ANNOUNCE] struts-layout 1.0b1 At 17:18 09/10/2002, you wrote: Very impressive. So this tag library sits on top of struts functionality? Yes, struts-layout is the last brick - it generates the output for the user. The differences between a struts application using the struts-html taglib and an application using the struts-layout one is in the jsps. The other parts (application core, struts action and form) are the same. With struts-layout, you don't have to bother about how to write a nice table, list, menu or treeview in HTML. You just insert the tag, and the component is displayed. The layout of the different components is done automatically. As a result there is no HTML code in the jsp which make it smaller, easier to write and to understand. Jean-Noel Jean-Noel Ribette wrote: Hello everybody I'm pleased to announce that struts-layout 1.0 beta 1 - an open source tag library for struts that allows to speed up interface creation - is available for download. struts-layout includes the following features: - UI components tags: form, input fields, javascript date pick-up calendar, sortable list, pager, tabbed panel, treeview and a few more. - Layout tags: grid, row and column. - skin support: a struts-layout application can load different css file, allowing dynamic change of colors, fonts and images. - CRUD support: struts-layout input field can be displayed read-write or read-only in function of what you're doing (creating, editing or viewing data) A new tutorial explains how to build a simple struts-layout page. All the components can be seen live on a demonstration news server. Changes since previous version includes several bug fixes, enhancements and new tags. For more information, visit http://struts.application-servers.com, and http://struts.application-servers.com/DemoServeurDeNews/allNews.do?reqCode =showAllNews for the demonstration. Best regards, Jean-Noel Ribette --__/ \__--- improve Jean-Noël Ribette --/-\-- Software engineer -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- Vincent Stoessel Linux Systems Developer vincent xaymaca.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] --__/ \__- improve Jean-Noël Ribette --/-\-- Ingénieur études et développement -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Extending DynaValidatorForm
Understood, however the problem I'm facing is that I have an ArrayList of Objects that I'd like to pass to the EditProd form , within this form the Method would create a String separated by some delimiter. This value would be then passed to the JSP to store in a field. Eventualy the EditProd form would read this field again and create the ArrayList back from the String. I also iterate through this ArrayList on the JSP page. Makes sense ? This could be maybe solved by some JSP tag that'd create an ArrayList (or something I can iterate through) from a delimited String on the JSP page itself. Maybe I'm doing it completely wrong, I even did try to use String[] in : form-property name=cats type=java.lang.String[]/ but that doesn't do any good. J Craig R. McClanahan wrote: On Fri, 11 Oct 2002, Jan Fetyko wrote: Date: Fri, 11 Oct 2002 07:47:20 -0400 From: Jan Fetyko [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Subject: Extending DynaValidatorForm Hi all, I've got a little confusion going on. I wanted to extend the DynaValidatorForm like this : public class EditProd extends org.apache.struts.validator.DynaValidatorForm { private String cats; public String getCats() { return cats; } ... } In the struts-config.xml I have defined few fields for the form : form-bean name=EditProd type=com.forms.EditProd form-property name=flag type=java.lang.Integer/ ... /form-bean but the form (JSP page) throws an error , cause it cannot find the Getter for cats. If I leave the cats out of the JSP page then it works fine, so the dynamicaly generated getters work fine. How do I access those Getters and Setters for cats? Is it possible at all ? If you are using DynaActionForm or DynaValidatorForm, you do *not* need to create methods in your form bean class itself -- you only need to declare them in struts-config as form-property elements. So, you'd want to add: form-property name=cats type=java.lang.String/ You can then interact with those properties from your business logic, if necessary, using either PropertyUtils: EditProd form = ...; String cats = (String) PropertyUtils.getSimpleProperty(form, cats); or directly using the underlying DynaBean APIs (DynaValidatorForm ultimately inherits from org.apache.commons.beanutils.DynaBean): EditProd form = ...; String cats = (String) form.get(cats); J Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] Craig R. McClanahan wrote: On Fri, 11 Oct 2002, Jan Fetyko wrote: Date: Fri, 11 Oct 2002 07:47:20 -0400 From: Jan Fetyko [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: struts [EMAIL PROTECTED] Subject: Extending DynaValidatorForm Hi all, I've got a little confusion going on. I wanted to extend the DynaValidatorForm like this : public class EditProd extends org.apache.struts.validator.DynaValidatorForm { private String cats; public String getCats() { return cats; } ... } In the struts-config.xml I have defined few fields for the form : form-bean name=EditProd type=com.forms.EditProd form-property name=flag type=java.lang.Integer/ ... /form-bean but the form (JSP page) throws an error , cause it cannot find the Getter for cats. If I leave the cats out of the JSP page then it works fine, so the dynamicaly generated getters work fine. How do I access those Getters and Setters for cats? Is it possible at all ? If you are using DynaActionForm or DynaValidatorForm, you do *not* need to create methods in your form bean class itself -- you only need to declare them in struts-config as form-property elements. So, you'd want to add: form-property name=cats type=java.lang.String/ You can then interact with those properties from your business logic, if necessary, using either PropertyUtils: EditProd form = ...; String cats = (String) PropertyUtils.getSimpleProperty(form, cats); or directly using the underlying DynaBean APIs (DynaValidatorForm ultimately inherits from org.apache.commons.beanutils.DynaBean): EditProd form = ...; String cats = (String) form.get(cats); J Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Jakarta Library Versions Used In Struts 1.1 B2
My team likes to keep track of what versions they're using of a third party libraries (.JAR files). The Struts 1.1B2 release is dependent on a dozen or so Jarkarta libraries. How can I determine which version of each library I got when I downloaded Struts 1.1 B? More specifically, which version of: 1) commons-beanutils.jar 2) commons-collections.jar 3) commons-dbcp.jar 4) commons-digester.jar 5) commons-fileupload.jar 6) commons-lang.jar 7) commons-logging.jar 8) commons-pool.jar 9) commons-resources.jar 10) commons-services.jar 11) commons-validator.jar 12) jakarta-oro.jar Is this documented anywhere? Some manifest.mf files have a specification version in them, but not all. In some cases, the specificaiton version is documented incorrectly. For example, in the struts.jar file which says 1.0, not 1.1 Thanks, JOHN -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Struts and state information
On Sun, 13 Oct 2002, Brett Elliott wrote: Date: Sun, 13 Oct 2002 22:07:13 -0700 From: Brett Elliott [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Struts and state information I would like to keep session state soley in cookies so I can use round robin HTTP load balancing versus sticky load balancing(sticky load balancing as in all requests are directed at a specific web server for a given user. I read Professional JSP, perused this mailing list and looked on the web and nothing really elaborates on where the state is stored by default. I see how the html:link /html:link directive is translated into a href=http://...;jsessionid=X/a but where does it get X and where does it store the session information related to X? Does it rely on the jsession ID being passed around in URLs then keep the associated session information cached on the server? So if you have multiple servers you will need to use sticky load balancing to make sure users only use one webserver? The X is the session identifier created by the container. Containser that support multiple back-end servers are *required* to ensure that, at any given point in time, all requests for the same session id must go to the same server. Advanced containers may support session migration or failover, but they are only allowed to move the session in between requests. Using a simple-minded round robin load balancing scheme violates this principle, and will cause you nothing but grief -- consider what happens when two simultaneous requests for the same session are sent to two different server instances, and they both update state information in their own copy of the session attributes. Your application's responsibility is to ensure that all the session attributes you create are Serializable - then it's up to the container to manage all of this for you, basically transparently. What options are there in case I want to keep all session state in cookies? That is, ideally, I would generate an encrypted cookie w/ CRC containing the logged in username and minimal information about the user. And I would like to do this within the confines of Struts. Thanks for any help and I aplogize if this is a redundant question. Session state is kept wherever you store it. :-) More seriously, cookies *sort of* correspond to session attributes, which is where you store state on the server side if you want to keep it. However, cookies have a couple os significant restrictions: * They can store only Strings, not objects * There is a limited capacity for storing cookies So, like everything in life, this is a decision of tradeoffs. Another alternative you should also consider, though, is storing your state information in hidden fields in the forms you create, so that it can be reread on the following submit. Although such attributes are still Strings, you don't have the length limits of cookies -- and it's easier to debug because you can View Source the pages to see what's really there. Craig -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Scaffold Framework
All: I saw a reference recently to Scaffold being outdated; however, I decided to look into it a little bit -- primarily because of the BaseAction class -- and downloaded it this morning to take a look at the code. It is obviously still being maintained and, indeed, is being upgraded for compatibility with Struts 1.1. So my question is: Is Scaffold indeed considered outdated, and if so, why? Anyone's reaction is welcome. Charles McClain Phone: 603.659.2046 email:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles - Forward problem
Hi, A Dilluns 14 Octubre 2002 16:44, Heligon Sandra va escriure: I only have to not cast the result of the findForwardConfig method ? No, you have to change the call to processActionForward for processForwardConfig. The TilesRequestProcessor overwrites processForwardConfig to look for tiles definitions. Sandra -Original Message- From: Antoni Reus [mailto:[EMAIL PROTECTED]] Sent: 14 October 2002 16:39 To: Struts Users Mailing List Subject: Re: Tiles - Forward problem Hi, A Dilluns 14 Octubre 2002 10:59, Heligon Sandra va escriure: I have overridden the TilesREquestProcessor in order to test if a user is authenticated for each request, but it doesn't work: protected boolean processPreprocess(HttpServletRequest request, HttpServletResponse response) { // Get the session object HttpSession session = request.getSession(); try{ // Test if the request is a login request String path = processPath(request, response); if ( !path.equals((String) /login) ) { // If not a login page, test if the user is authenticated on the application server User userInfo = (User)session.getAttribute(Constants.USER_KEY); if ( userInfo == null || (userInfo != null userInfo.getSessionId() == 0) ) { Change this: processActionForward(request, response, (ActionForward)appConfig.findForwardConfig(login)); for this: processForwardConfig(request, response, appConfig.findForwardConfig(login)); } } } // if a servlet exception occurs catch (ServletException ex) { } //if an input/output error occurs catch (IOException ex) { } return true; } -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DAO or ... ?
The generic pattern is just the facade pattern. A unified interface to a set of interfaces in a subsystem. You may incorporate the usage of a Proxy pattern or Mediator pattern to produce layering such as the facade-DAO does. - Original Message - From: Couball, James [EMAIL PROTECTED] To: 'Struts Users Mailing List' [EMAIL PROTECTED] Sent: Monday, October 14, 2002 12:19 PM Subject: RE: DAO or ... ? I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- [EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail:
RE: DAO or ... ?
How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:struts-user- [EMAIL PROTECTED] For additional commands, e-mail: mailto:struts-user- === message truncated === __ Do you Yahoo!? Faith Hill -
Re: Help with Dynamic Includes
Hi, Have you check the Tiles framework that come with Struts ? Cedric Greg Cutler wrote: Hello - I'm new to the Struts architecture, and am writing a small application to teach myself. I've got the basic concepts and simple design patterns, but am having a problem trying to structure part of my presentation logic in a struts-like way. I'd like to build up part of a page by including the results from another action, called dynamically. Here's what I've got: form-beans form-bean name=ParentForm type=my.ParentForm / form-bean name=ChildForm type=my.ChildForm / /form-beans global-forwards forward name=showParent path=/parent.do redirect=false / forward name=includeChild path=/child.do?action=show redirect=false / /global-forwards action-mappings action path=/parent type=my.ParentAction name=ParentForm forward name=success path=/parent.jsp redirect=false / /action action path=/child type=my.ChildAction name=ChildForm forward name=show path=/child.jsp / /action /action-mappings Where parent.do and it's corresponding form take some parameters, do some logic, and forward to parent.jsp for display. However, I would also like to include child.do, but want to pass it some additional parameter foo=bar when including it. I've already set up some of that information (action=show) in the global forward, but how do I wrap up additional parameters for an include. I've seen how to *link* to this with (for example): html:link forward=includeChild paramId=foo paramName=ParentForm paramProperty=foo / but am looking for the same kind of functionality to do includes. I can get _something_ to work with jsp:include page=/child.do?action=showfoo=bar / but this still isn't either 1) building it dynamically or 2) very struts-like since I'm not taking advantage of my global forward configuration for the action=show. I'm open to using jsp methods, struts, templates, whatever. I'm just learning, but can't find this one. If someone could point me in the right direction (or tell me how my design is wrong anyway and it would be better to do it like ..xyz...) it would be greatly appreciated. Thanks, Greg __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tiles problem with Struts action path - Tiles and tabbeddisp lay
Cedric - While this solution will work in IE browsers and Netscape 6+ browsers, it isn't a particularly robust solution, as it relies on the URL in the browser location string, and this varies depending on the particular browser version (try your solution on Netscape 4.7, and see what happens). A more robust solution requires that we have access to the action path at the JSP level, similar to the way we do in an Action class. In order to robustly render a URL based on a Tiles list, we need to know the action path that initially rendered the Tile. This suggests to me adding an attribute for this to the Tile object, so that a Tile is aware of the action path from which it was called. Our other alternative is to have a custom request processor, which gets the action path and puts it into a request attribute, which will be accessible in the destination JSP -- this is a less robust and less desirable solution than having direct access to the action path through some Tiles attribute. For example, I would like to be able to do something like: action = tile.getActionPath(); Don P. -Original Message- From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:47 AM To: Struts Users Mailing List Subject: Re: Tiles and tabbed display Hi, You are right that the actual code doesn't works well if you use an action URL instead of a jsp URL. The solution is to not set the page URI at all when computing the tabs href. Like this, the browser use the original URL. To do this, simply replace the offending line by: // compute href String href = ?+parameterName + = + index; Cedric Peterkofsky, Don wrote: Cedric - I've been using Struts/Tiles to implement a tabbed display page, and in general it works very nicely. However, I think there is an oversight in the tabsLayout example, which will cause a problem in use. This has to do with how the href is calculated for the links in the tabs. In the iteration through the tabsList, this code is setting the href for each tab: // compute href String href = request.getRequestURI() + ?+parameterName + = + index; By doing this, we will end up with a link to the jsp file of the tabbed display page, which we don't want, rather than a link to the action that calls the jsp, which is what we do want. By doing it the way it is done in the tabsLayout.jsp, the links from the tabs will not go through an action and will not go through the Struts controller, and therefore won't be able to process the Tiles. For example, what we want to see in a tab href is: http://localhost:8080/wctemplates/tabstemplate.do?tab=1 However, what we do see is: http://localhost:8080/wctemplates/tabsLayout.jsp?tab=1 What needs to happen, is for each tab href to be a link that is made up of the action name, i.e./servlet/tabAction.do?selected=1. Have you experienced this issue, or had any previous inquiries about this? What are your thoughts? Thanks, Don Peterkofsky -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: Tiles problem with Struts action path - Tiles and tabbed disp lay
The action mapping is available in the request (!) under the key of o.a.s.Globals.MAPPING_KEY. Peterkofsky, Don wrote: Cedric - While this solution will work in IE browsers and Netscape 6+ browsers, it isn't a particularly robust solution, as it relies on the URL in the browser location string, and this varies depending on the particular browser version (try your solution on Netscape 4.7, and see what happens). A more robust solution requires that we have access to the action path at the JSP level, similar to the way we do in an Action class. In order to robustly render a URL based on a Tiles list, we need to know the action path that initially rendered the Tile. This suggests to me adding an attribute for this to the Tile object, so that a Tile is aware of the action path from which it was called. Our other alternative is to have a custom request processor, which gets the action path and puts it into a request attribute, which will be accessible in the destination JSP -- this is a less robust and less desirable solution than having direct access to the action path through some Tiles attribute. For example, I would like to be able to do something like: action = tile.getActionPath(); Don P. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: repeating input fields
instead of: property=id property=description use: property=purposes[1].id property=purposes[1].description That makes sense! I made the changes to the JSP file and also added indexed getter/setter to the form bean. public class LoansForm extends ActionForm { private LoansPurpose[] purposes = null; public LoanPurpose[] getPurposes() {return purposes;} public void setPurposes( LoanPurpose[] v ) {purposes = v;} public LoanPurpose getPurposes( int idx ) {return purposes[idx];} public void setPurposes( int idx, LoanPurpose v ) {purposes[idx] = v;} public void reset(ActionMapping mapping, HttpServletRequest request) {purposes = null;} } But now when I submit the Save I'm getting an exception javax.servlet.ServletException: BeanUtils.populate ... - Root Cause - java.lang.reflect.InvocationTargetException at sun.reflect.GeneratedMethodAccessor16.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:475) at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:410) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:749) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:780) at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:793) at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:726) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:978) Caused by: java.lang.NullPointerException at com.illuminat.cml.LoansForm.getPurposes(LoansForm.java:1420) ... 49 more (obviously, I've trimmed the exception report) Line 1420 of LoansForm.java is the indexed getter. So my purposes array is null and I'm trying to get the value at a particular index (idx=3 in this test run). The array is null because I set it to that in the reset() method. That's what I'm supposed to do though, isn't it? How can I know to allocate the array and what size it should be? I'm missing something here! For instance, I'm executing a Save so why is the indexed getter being called and not the indexed setter? This should get you started... It did indeed, and I thank you for that. Unfortunately, it has raised more questions and I'm at a loss as to how to proceed! Thanks again, Kevin __ Do you Yahoo!? Faith Hill - Exclusive Performances, Videos More http://faith.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
error page for jsp
Hi folls; I don't want to see the exception error if anything goes wrong in jsp. Should I use % page errorPage=errorpage.jsp %? or Struts has better mechanism to handle the exception is thrown in jsp? Thanks! Billy Ng
RE: DAO or ... ? [Scanned for known viruses]
James - I've attached a few files from my upcoming book Struts Kick Start that provide a basic design pattern that sounds like it may be similar to what your describing. What I do is: - Create a Value Object that encapsulates data communicated with the Model component. - Create a facade class that accepts and returns value objects through 'business methods'. By defining the facade to work at a 'business method' level, it helps keep any code related to a particular persistence layer or back-end system out of the Action class. This also addresses the issues you described of 'designing to test' - the clean seperation between the Action class and the Model components that the Facade provides simplifies testing. - Create the form bean to provide set/get methods that also accept and return value objects - this greatly simplifies the Action class and isolates it from changes. The Action class (a bit simplified - I've taken out detailed comments and exception handling) goes something like: // cast the form bean CustomerForm cf = (CustomerForm) form; // Create a facade to interface to the back-end system CustomerWSFacade facade = new CustomerWSFacade(); // Extract the value object from the form bean CustomerValueObject cvo = cf.getValueObject(); // Pass the value object to the facade. It returns an update value object cvo = facade.addressChange( cvo ); // Use the returned value object to update the values in the form bean. cf.setValueObject(cvo); These particular classes come from the chapter on providing integration with Axis for Web Services. Another chapter uses the identical set of classes to communicate with JBoss using a Session Bean - all I did was write a different facade class. The point of this was to demonstrate a design that made it very simple to perform maintenance or changes on the back-end or persistence layer. Regarding testing - I'd recommend you take a look at the StrutsTestCase project at sourceforge - it provides some great templates for both JUnit and Cactus tests that are designed for Struts. Makes JUnit/Cactus testing pretty straightforward. A copy of this and detailed directions also come with the book. http://strutstestcase.sourceforge.net/ Best of luck - Kevin Author, Struts Kick Start (See attached file: customer.zip) Couball, James [EMAIL PROTECTED] on 10/14/2002 01:19:16 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To:'Struts Users Mailing List' [EMAIL PROTECTED] cc: (bcc: Kevin Bedell/Systems/USHO/SunLife) Subject:RE: DAO or ... ? I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell
RE: DAO or ... ?
That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain object in the database ?: - use the DAO pattern of java blueprint (persistence layer is called into classes) - call to persistence statements into action code : // store example try { PeristenceLayer pl = getPerstitenceLayer(); pl.save(domainObject); } catch (Exception -- Kevin Viet [EMAIL PROTECTED] ActiVia Networks -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail:
Re: Best practices using value objects
You can use BeanUtils.copyProperties to copy properties between forms and value beans. Dynamic forms have nothing to do with this. Your form could be dynamic or static. I would only add properties to the value bean if it ends up in the database. Also, it's best practice to not use Vector. Your variable should be of type List and implemented with ArrayList instead of Vector. Dave From: [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Best practices using value objects Date: Mon, 14 Oct 2002 11:48:25 -0400 Best practices using value objects I still have questions regarding best practices, the use value object and of the beanutil package. How would you convert a value object to a form bean if a property of the VO is a list of other object that would need to be converted to a form? Here is an example of what I am trying to do. I have value objects coming from the business tier. VOSchool String address Vector students VOStudent String name int status boolean isPresident Vector courses I have a page with a lists of all students names, a radio button to indicate if he is the president and a checkbox that changed the status is selected. I think I need a StudentForm with all the info from the VO plus a boolean isSelected property. My SchoolForm need all info from the VO plus a president property. - How can I best reuse by VOs? - Should I add a property to the VOs? How? - Are the forms dynamic forms? - Should I copy all attributes form the VO to a form? - Do I need to write a converter for all my VOs, VO to form and form to VO? I think it is a very common problem but I was not able to find a pretty solution nor an example on how to do this. Thanks Stephan _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Tiles problem with Struts action path - Tiles and tabbeddisp lay
Eddie - Thanks for the pointer to the request attribute -- that got me what I needed. Cedric - Here is the code snippet below, that will get the action in a robust way, and allow us to write out the href in the tabs in a Struts-compatible way; you may want to update your tabsLayout JSP example accordingly: %@ page import=org.apache.struts.config.ActionConfig % % String key = org.apache.struts.Globals.MAPPING_KEY; ActionConfig actionConfig = (ActionConfig) request.getAttribute(key); String action = actionConfig.getPath(); ... % / Struts-tiles tabs rendering logic / % logic:iterate id=tab name=tabList type=org.apache.struts.tiles.beans.MenuItem % // compute href String href = request.getContextPath() +/ + action + .do + ?+parameterName + = + index; // get tab link Don P. -Original Message- From: Eddie Bush [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:50 AM To: Struts Users Mailing List Subject: Re: Tiles problem with Struts action path - Tiles and tabbed disp lay The action mapping is available in the request (!) under the key of o.a.s.Globals.MAPPING_KEY. Peterkofsky, Don wrote: Cedric - While this solution will work in IE browsers and Netscape 6+ browsers, it isn't a particularly robust solution, as it relies on the URL in the browser location string, and this varies depending on the particular browser version (try your solution on Netscape 4.7, and see what happens). A more robust solution requires that we have access to the action path at the JSP level, similar to the way we do in an Action class. In order to robustly render a URL based on a Tiles list, we need to know the action path that initially rendered the Tile. This suggests to me adding an attribute for this to the Tile object, so that a Tile is aware of the action path from which it was called. Our other alternative is to have a custom request processor, which gets the action path and puts it into a request attribute, which will be accessible in the destination JSP -- this is a less robust and less desirable solution than having direct access to the action path through some Tiles attribute. For example, I would like to be able to do something like: action = tile.getActionPath(); Don P. -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web Development FAO of the UN - Consultant -Original Message- From: Kevin Viet [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 4:45 PM To: struts-user Subject: DAO or ... ? My question is a web app design question. What pattern you guys follow when you want to save a domain
Re: DAO or ... ?
The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 9:57 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? So where should one invoke the persistance layer? -Original Message- From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 22:51 To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? Importance: High Hi Kevin Avoid persistence in Action code as much as you can. This is the general recommendation. Wellington Silva Author of JSP and Tag Libraries for Web
RE: DAO or ... ?
I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great. /--\/---\ /\ |Client|-- |API|--|Core| |Code || | |Code| \--/\---/ \/ The API is now your fire break. Nothing on the Core Code side has to worry about displaying anything and nothing in the Client Code has to worry about calculating anything. Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday,
RE: DAO or ... ?
you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier...
Re: DAO or ... ?
That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like call into your core code and your core code doesn't need to worry about what calls it, only about acting upon requests. Then use the actions to call into the API and pass the API return values to the JSPs. Works great.
RE: DAO or ... ?
Jacob, I have the GoF book (you did realise that GoF is it's nickname right?). I have read it quite a few times and it sits on my shelf less than 36 inches from my keyboard. The book is wonderful and the patterns are even more wonderful. This does not stop me from thinking that they names that they chose are sub-optimal or non-intuitive. Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:12 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' ( http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can
RE: DAO or ... ?
Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the Action! Write all your core application code (business rules, persistence, communications etc) in a way that has no connection to the view portion of your system and then create a API to it. This way you can have any client you like
RE: DAO or ... ?
is there a newsletter for geeks that i'm missing? -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:16 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM
RE: DAO or ... ?
It's called experience it's why they pay us old guys more than you young bucks! ;-) -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:19 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? is there a newsletter for geeks that i'm missing? -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:16 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' ( http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 23:04 To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: DAO or ... ? You invoke your persistence code in the same place that you would invoke any other code ... not in the
Re: DAO or ... ?
To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' (http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 8:16 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? But you still call the API from the action right - is this not invoking the functionality that persists your data? Seems a bit like semantic juggling to me... (after all the persistance layer is just an abstraction API on top of writing to db/disk/punchcard itself...) ;-) I would however agree that there ought to be some sort of abstracting layer between the view and the implementation specific details of the p-tier... -Original Message- From: Chappell, Simon P
RE: DAO or ... ?
It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management
RE: DAO or ... ?
I'm working on finishing up a paper comparing Adapter, Bridge, and State Patterns in OO, but I don't remember reading/hearing anything about the GoF :-P -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:26 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns'
ActionForm Value Objects
I have an ActionForm (ContactForm) object in scope, and _also_ a ContactImpl value object that pretty much mirrors the get/set methods in the ContactForm. I'm using the BeanUtils.copyProperties method to move the properties back and forth, but I'm confused as to when each of the objects should have priority. (IOW, when to change a property in which one.) I found myself using: bean:write name=contact property=prospectId/ and then wondering why the property didn't have the correct value. So... I think the rule is that in the JSP associated with the ActionForm, you should be using the instance of the form as the bean for any extra display work that must be done outside of the html:text, etc. tags that go inside the html:form tags. And then the Value Object is only used at the very beginning to populate the form the first time for editing, and at the last minute before it gets sent off to the DAO to be persisted. Is that right? Thanks in advance for helping me get this straight, -- Wendy Smoak http://sourceforge.net/projects/unidbtags
RE: DAO or ... ?
I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
difference between forward and include?
The DTD specifies for attributes named 'forward' and 'include' for action. These have the same documentation. Is there any difference? -a -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
It's a good job that you have all of us supplementing your education then! I'll be having a stern word or two with your professors, concerning this lamentable oversight on their part! ;-) Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:30 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? I'm working on finishing up a paper comparing Adapter, Bridge, and State Patterns in OO, but I don't remember reading/hearing anything about the GoF :-P -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:26 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' ( http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the (business/persistence) layer that the actions will call independently of struts, actions, etc. Encapsulating that layer in an API (or wrapping with a session bean) makes this possible. Sincerely, James. -Original
Re: DAO or ... ?
We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: ActionForm Value Objects
Wendy Smoak wrote: I have an ActionForm (ContactForm) object in scope, and _also_ a ContactImpl value object that pretty much mirrors the get/set methods in the ContactForm. I'm using the BeanUtils.copyProperties method to move the properties back and forth, but I'm confused as to when each of the objects should have priority. (IOW, when to change a property in which one.) I found myself using: bean:write name=contact property=prospectId/ and then wondering why the property didn't have the correct value. So... I think the rule is that in the JSP associated with the ActionForm, you should be using the instance of the form as the bean for any extra display work that must be done outside of the html:text, etc. tags that go inside the html:form tags. And then the Value Object is only used at the very beginning to populate the form the first time for editing, and at the last minute before it gets sent off to the DAO to be persisted. Is that right? Sounds good! Thanks in advance for helping me get this straight, Your goal in doing the copy in the first place is to minimize hitting the database, and present the user with the exact incorrect values they entered - and not have to worry about those values making it into your database. So, yes, there are two hits here: 1 - retrieve the data for editing; 2 - update the data (once the user has signaled they are done editing and wish their changes to be persisted) Sounds good :-) -- Eddie Bush -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DAO or ... ?
I'd say one week working the printout desk will suffice! - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:36 PM Subject: RE: DAO or ... ? It's a good job that you have all of us supplementing your education then! I'll be having a stern word or two with your professors, concerning this lamentable oversight on their part! ;-) Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:30 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? I'm working on finishing up a paper comparing Adapter, Bridge, and State Patterns in OO, but I don't remember reading/hearing anything about the GoF :-P -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:26 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' ( http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you use EJBs or not, this pattern encapsulates the ideas that Simon was mentioning. Does anyone know the name of the more general pattern that doesn't involve Session Beans specifically? One of my general concerns is design to test. I like to be able to test the
RE: DAO or ... ?
Wow, you're mean! Even I wouldn't make him do that. How about one night pulling security at the Student Union? -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:46 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? I'd say one week working the printout desk will suffice! - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:36 PM Subject: RE: DAO or ... ? It's a good job that you have all of us supplementing your education then! I'll be having a stern word or two with your professors, concerning this lamentable oversight on their part! ;-) Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:30 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? I'm working on finishing up a paper comparing Adapter, Bridge, and State Patterns in OO, but I don't remember reading/hearing anything about the GoF :-P -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:26 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern: http://www.javaworld.com/javaworld/javatips/jw-javatip68.html An EJB version is mentioned in 'EJB Design Patterns' ( http://www2.theserverside.com/books/EJBDesignPatterns/index.jsp) too. jamie --- Couball, James [EMAIL PROTECTED] wrote: I recommend taking a look at the Session Façade pattern in the Java Blue Prints. No matter if you
RE: DAO or ... ?
Yup, we learned algoritms and state machines. I know that we didn't learn patterns. I am so glad that we did learn about state machines, because they are wonderful for web applications. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
You guys have it lucky to even know what a pattern is. I graduated with a C.S. degree in 1983 - object oriented programming barely existed then, let alone taught. Matter of fact we were required to learn IBM Assembler, and either COBOL or PL/1 as a graduation requirement! If I remember right, my Software Engineering class dealt with writing a basic compiler for a COBOL-type language (written in assembler, or course). You ought to be where I am trying to play catch-up on all of this Java / web / struts / stuff while trying to deliver projects on time and budget! Jerry -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] 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 (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
does anybody remember the read ahead rule - wasn't that something like a pattern? I'm not sure, but I think this rule origins from Jackson (70s or 80s) -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Montag, 14. Oktober 2002 21:45 To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
we are taught patterns in programming through example, which means we learn about it one day in lecture, then we get an absurdly complex assignment to make sure we not only know the pattern, but to also make sure that we have no social life. I can't complain though, the program is nationally accreditted :-) -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 3:00 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? Yup, we learned algoritms and state machines. I know that we didn't learn patterns. I am so glad that we did learn about state machines, because they are wonderful for web applications. Simon -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] winmail.dat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: DAO or ... ?
Maybe, but I'd prefer to make him strike up conversations with the 45 year-old professional student outside the Union and make requests for some original poetry. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:56 PM Subject: RE: DAO or ... ? Wow, you're mean! Even I wouldn't make him do that. How about one night pulling security at the Student Union? -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:46 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? I'd say one week working the printout desk will suffice! - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:36 PM Subject: RE: DAO or ... ? It's a good job that you have all of us supplementing your education then! I'll be having a stern word or two with your professors, concerning this lamentable oversight on their part! ;-) Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:30 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? I'm working on finishing up a paper comparing Adapter, Bridge, and State Patterns in OO, but I don't remember reading/hearing anything about the GoF :-P -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:26 PM To: Struts Users Mailing List Cc: Subject: Re: DAO or ... ? To be truthful, I hadn't heard of them until about 2 years ago. I had been mired in a job that did not allow me to pursue my design and professional goals. Once I got out of there and found a place that needed an experienced developer that was familiar with Java and C++, I was lucky enough to work with peers who got me back on track. ;) - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:20 PM Subject: RE: DAO or ... ? Thanks John. These youngsters ... what do you do with them!? ;-) -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:16 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? That's the book he was referring to when he said GoF. They are called the Gang of Four. - Original Message - From: Hookom, Jacob John [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:12 PM Subject: RE: DAO or ... ? you should pick up Design Patterns - Elements of Reusable Object-Oriented Software by Gamma, Helm, Johnshon and Vlissides under Addison-Wesley Publishing it's the bible for design patterns -Original Message- From: Chappell, Simon P [ mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 2:10 PM To: Struts Users Mailing List Cc: Subject: RE: DAO or ... ? I'm sure that if I was an accademic chap sitting in my Ivory tower, I'd be able to remember the official names, but some days I'm too busy using the actual patterns to get beyond thinking I need a wrapper here and I'd better hide that behind an API. Maybe I need a cheat sheet so that I can look up API = Facade Wrapper = Proxy etc etc Some days I REALLY need one of those. Simon -Original Message- From: John Owen [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:58 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? The funny thing is that they gave them these names so we (developers) could communicate better. ;) It was one of the reasons for the book. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 1:53 PM Subject: RE: DAO or ... ? You know, patterns are wonderful, but am I the only person who thinks that the names that were selected by the GoF are terrible? I may just be old fashioned, but I think in terms like wrapper, API and controller, not facade and command. Oh well. At least I can use patterns even I can't remember for the life of me what the official name for it is! :-) Simon - Simon P. Chappell [EMAIL PROTECTED] Java Programming Specialist www.landsend.com Lands' End, Inc. (608) 935-4526 -Original Message- From: Couball, James [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 1:21 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? That was it, the Command pattern was what I was thinking of... but Session Façade had a bit more to it. Thanks for the info. James. -Original Message- From: Jamie M [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 10:37 AM To: Struts Users Mailing List Subject: RE: DAO or ... ? How about the Command Pattern:
RE: DAO or ... ?
You have my sympathy and my respect. While I graduated after you, they still hadn't invented the World Wide Web and Java was a way off yet. Almost everything skill that I use to earn my living today is something that I have taught myself. I spotted Java and learned it back when it first came out, and I have read enough material since I graduated to sink a small aircraft carrier. It seems to me that those that get anywhere in this industry are self-taught self-starters. Sure, we start with a CS degree, but everything goes out of date so quick in this industry, that you can't sit back on your laurels and wait for people to throw money at you. You have to go go and learn stuff outside of work. As for patterns, I was associated with some Smalltalkers for a while and heard them talking about patterns and saw the GoF, bought a copy for myself and have been using them ever since (just not calling them the right names! ;-) Simon -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:02 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? You guys have it lucky to even know what a pattern is. I graduated with a C.S. degree in 1983 - object oriented programming barely existed then, let alone taught. Matter of fact we were required to learn IBM Assembler, and either COBOL or PL/1 as a graduation requirement! If I remember right, my Software Engineering class dealt with writing a basic compiler for a COBOL-type language (written in assembler, or course). You ought to be where I am trying to play catch-up on all of this Java / web / struts / stuff while trying to deliver projects on time and budget! Jerry -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] 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 (800)388-4675. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
action include or forward attribute not working?
I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: action include or forward attribute not working?
You need to do it like this: action path=/Registration forward name=success path=/registration.jsp/ /action Dave From: Andy Kriger [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: action include or forward attribute not working? Date: Mon, 14 Oct 2002 16:15:38 -0400 I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ Join the worlds largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action include or forward attribute not working?
like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action include or forward attribute not working?
try this one: action path=/Registrattion parameter=/registration.jsp scope=request type=org.apache.struts.actions.ForwardAction validate=false /action -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Montag, 14. Oktober 2002 22:16 To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action include or forward attribute not working?
Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] winmail.dat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Origin of MVC design pattern - was RE: DAO or ... ?
Interestingly enough - MVC was already around even back then. Below is an e-mail I received from a Professor Trygve Reenskaug who is based in Norway now but who is widely credited as being the inventor of the MVC pattern while at the Xerox PARC in the 70's. I traded e-mails with him while researching the origins of MVC for my book. Dear Kevin Bedell, I was visiting scientist with the Learning Research Group (Alan Kay's Small talk group) in 1978/79. My main project was to create a human friendly interface to an activity network. The example was the activity network for the building of a 400.000 tons tanker at a Norwegian shipyard. The popular idea at that time was to make objects visible on the screen so that the user could manipulate them directly. This was clearly not practicable with some 450 activity objects. Further, the users were used to seeing their plan from several perspectives: individual activities, activity networks, timing diagrams, resource loading diagrams, etc. My first idea was to separate presentation from information because the information structure is reasonably stable while the way we need to see it and manipulate it varies with the task. (This idea stems from around 1970 when I first became interested in distributed systems.) My second idea, or hope, was to create general editors that edited certain aspects of an information objects. E.g. a general graph editor, a table (property) editor, a text editor, etc. The information objects would then have to support the various interfaces needed by the editors. The third idea was the concept of a *tool*, whatever the user applies to accomplish a certain task. In practice, this meant something that managed and coordinated several editors. (A window with its panes) The naming of these three concepts was the subject of long discussions, particularly with Adele Goldberg. Model-Editor-Tool was one possibility. We finally ended with Model-View-Controller. TI implemented the first MVC in Smalltalk-76 as part of my activity network experiments, and have later used it for other projects, writing the code in Smalltalk-78 and Smalltalk-80. It is worth noting that MVC was modified by Adele Goldberg and her group when they developed the Smalltalk-80 library. The original View was an editor with both input and output. The Smalltalk-80 View is output only. The original Controller (Tool) is missing from Smalltalk-80, while the Controller now is the input device. There is also some of the MVC background in http://www.ifi.uio.no/~trygver/documents/9607OOUserInterface/960711-column.pdf MVC could profitably be split into several patterns. An MVC pattern language may be needed. Patterns could e.g., be Tool - for decoupling user and model (as described above) View - for inspecting and editing a model object DirectManipulationInterface - refining the View Controller - for coordinating a number of views Mediator - for loose coupling between View and Model Observer - for keeping Model and View in synch Facade - for complex models consisting of many objects etc. These are just initial thoughts, I may refine them some day. Or may be somebody else will do it. I apologize for taking so long with my answer. I hope it still may may be useful to you. Best regards --Trygve Kevin Bedell wrote: Distinguished Professor: I am writing a book now on STRUTS, which is a MVC-based framework for developing web applications. Struts is an open source project under the Apache Software Foundation. In researching the origins of the MVC design pattern I came across a posting to comp.lang.smalltalk from 1994 in which an Engineer named Carl Swensson mentioned you as being generally cited as being the creator of the MVC concept while working at the XEROX PARC in the late 1970's. Can you share some short thoughts on your memories of the original designs? I'm very interested in what original problem you used this pattern to solve. Do you remember much about the team that you worked with? Also, did the MVC pattern evolve in parallel with Smalltalk? Or did it to some extent drive the development of Smalltalk itself? I appreciate very much any response you have time to write. Thank you very much, Kevin Bedell Author of the upcoming book from SAMS, Struts: Rapid Working Knowledge -- Trygve Reenskaug mailto: [EMAIL PROTECTED] Morgedalsvn. 5A http://www.ifi.uio.no/~trygver N-0378 Oslo Tel: (+47) 22 49 57 27 Norway Jerry Jalenak [EMAIL PROTECTED] on 10/14/2002 04:02:17 PM Please respond to Struts Users Mailing List [EMAIL PROTECTED] To:'Struts Users Mailing List' [EMAIL PROTECTED] cc: (bcc: Kevin Bedell/Systems/USHO/SunLife) Subject:RE: DAO or ... ? You guys have it lucky to even know what a pattern is. I graduated with a C.S. degree in 1983 - object oriented programming barely existed then, let alone taught. Matter of fact we were
RE: action include or forward attribute not working?
Actually, I have no problem seeing *.jsp. MVC only requires that the Model, View and Controller be separated. Using a mix of *.do and *.jsp is not going to violate MVC. For simple pages that require no pre-processing, we used direct calls to the JSP. Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:19 PM To: Struts Users Mailing List Subject: RE: action include or forward attribute not working? Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail:mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
[OT] RE: action include or forward attribute not working?
I remember a fellow posting a link to his struts site and everyone went off on him for having jsp urls ;-) -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 3:24 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? Actually, I have no problem seeing *.jsp. MVC only requires that the Model, View and Controller be separated. Using a mix of *.do and *.jsp is not going to violate MVC. For simple pages that require no pre-processing, we used direct calls to the JSP. Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:19 PM To: Struts Users Mailing List Subject: RE: action include or forward attribute not working? Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail:mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] winmail.dat -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action include or forward attribute not working?
Good point. however, i'm not convinced that that is the absolute way to go. First off, there is no interaction with the Model component in the MVC for this context. also, if Struts is supposedly a variation of the MVC framework, why is the html:link tag provided? seems that would be a contradiction in itself if struts claims to be MVC compliant. for my work, i have no qualms in directing to the jsp directly if there is no interaction with the model components. i question some of the things we learned in lab btw. Anybody got any comments on this? -kael Teh -Original Message- From: Hookom, Jacob John Sent: Monday, October 14, 2002 3:19 PM To: Struts Users Mailing List Subject: RE: action include or forward attribute not working? Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: DAO or ... ?
Thanks - it's nice to know somebody out there respects me! :-) Seriously though, I agree with you 100%. Technology changes to quickly to be able to rest on your laurels - just look at this list and evolution of Struts in the past 90 days! Fortunately for me, I managed to find this list when I first started learning Java (about 6 months ago) - and I can tell you it has been the absolute best resource, and not just for struts and java. I'm now to a point where I'm trying to refine my coding techniques, hence my interest in patterns. Besides the GoF book, are the any really great books on patterns that are Java and web development specific? It would be nice to have all of this stuff in one location.. Jerry -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:12 PM To: Struts Users Mailing List Subject: RE: DAO or ... ? You have my sympathy and my respect. While I graduated after you, they still hadn't invented the World Wide Web and Java was a way off yet. Almost everything skill that I use to earn my living today is something that I have taught myself. I spotted Java and learned it back when it first came out, and I have read enough material since I graduated to sink a small aircraft carrier. It seems to me that those that get anywhere in this industry are self-taught self-starters. Sure, we start with a CS degree, but everything goes out of date so quick in this industry, that you can't sit back on your laurels and wait for people to throw money at you. You have to go go and learn stuff outside of work. As for patterns, I was associated with some Smalltalkers for a while and heard them talking about patterns and saw the GoF, bought a copy for myself and have been using them ever since (just not calling them the right names! ;-) Simon -Original Message- From: Jerry Jalenak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:02 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? You guys have it lucky to even know what a pattern is. I graduated with a C.S. degree in 1983 - object oriented programming barely existed then, let alone taught. Matter of fact we were required to learn IBM Assembler, and either COBOL or PL/1 as a graduation requirement! If I remember right, my Software Engineering class dealt with writing a basic compiler for a COBOL-type language (written in assembler, or course). You ought to be where I am trying to play catch-up on all of this Java / web / struts / stuff while trying to deliver projects on time and budget! Jerry -Original Message- From: John Owen [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:45 PM To: Struts Users Mailing List Subject: Re: DAO or ... ? We were taught algorithms and finite state machines, but I don't remember any design pattern coverage. I graduated in 1994 and other than that, they perfectly prepared me for my future as a developer. We covered many software design principles in my Software Engineering classes, but the memory is so vague that I can't recall if anything was categorized into patterns. - Original Message - From: Chappell, Simon P [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, October 14, 2002 2:33 PM Subject: RE: DAO or ... ? I have no idea whether they teach patterns in University. I graduated in 1990 and we didn't even have the Internet back then let alone Patterns! Jacob: How about it my friend? Do they teach patterns in the UW? Simon -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 2:29 PM To: 'Struts Users Mailing List' Subject: RE: DAO or ... ? It's called experience it's why they pay us old guys more than you young bucks! ;-) LOL! It's also called being absolutely CERTAIN that someone has solved this problem before, and not going off reinventing the wheel. As an aside, are patterns being taught in computer science? I'm working on a degree and the senior-level course I'm taking this semester has been the first time I've seen a lecture about them. And then he only covered three (Factory, Abstract Factory and Singleton) and not very in depth at that. I like Applied Java Patterns by Stephen Stelting Olav Maassen. While the GoF book is surely timeless, I'm guessing the examples are not written in Java. With Applied Java Patterns (and Core J2EE Patterns) I can cut and paste and have a head start on the implementation. -- Wendy Smoak Applications Systems Analyst, Sr. Arizona State University PA Information Resources Management -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail:
RE: [OT] RE: action include or forward attribute not working?
No one said life is fair. Even if I find myself in the minority, I still have no problem with *.jsp. The trick is to know which is the best use for which tool. Direct calls to JSP can be fine if there is no pre-processing required on a page. Any page that needs any setup should be called through an appropriate action. Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:26 PM To: Struts Users Mailing List Subject: [OT] RE: action include or forward attribute not working? I remember a fellow posting a link to his struts site and everyone went off on him for having jsp urls ;-) -Original Message- From: Chappell, Simon P [mailto:[EMAIL PROTECTED]] Sent: Mon 10/14/2002 3:24 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? Actually, I have no problem seeing *.jsp. MVC only requires that the Model, View and Controller be separated. Using a mix of *.do and *.jsp is not going to violate MVC. For simple pages that require no pre-processing, we used direct calls to the JSP. Simon -Original Message- From: Hookom, Jacob John [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:19 PM To: Struts Users Mailing List Subject: RE: action include or forward attribute not working? Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail:mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: action include or forward attribute not working?
Now your view is tied to that particular jsp and you can't change it for a different one later or any other presentation logic format. Also, you've circumvented any common logic that the controller might be doing (authentication, logging, etc). Dave From: Chappell, Simon P [EMAIL PROTECTED] Reply-To: Struts Users Mailing List [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Subject: RE: action include or forward attribute not working? Date: Mon, 14 Oct 2002 15:24:00 -0500 Actually, I have no problem seeing *.jsp. MVC only requires that the Model, View and Controller be separated. Using a mix of *.do and *.jsp is not going to violate MVC. For simple pages that require no pre-processing, we used direct calls to the JSP. Simon -Original Message- From: Hookom, Jacob John [mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:19 PM To: Struts Users Mailing List Subject: RE: action include or forward attribute not working? Kael, this is MVC, you should never see *.jsp ;-) We went over this before in lab -Original Message- From: Teh, Kah Loong Sent: Mon 10/14/2002 3:15 PM To: Struts Users Mailing List Cc: Subject: RE: action include or forward attribute not working? like you said, since you don't need an action try using html:link i.e., html:link page=/registration.jsp register here /html:link -kael Teh -Original Message- From: Andy Kriger [ mailto:[EMAIL PROTECTED]] Sent: Monday, October 14, 2002 3:16 PM To: Struts Users Mailing List Subject: action include or forward attribute not working? I am setting up the following: a JSP containing a form; the submit action of the JSP calls a Struts Action class. Since I don't really need an action simply to forward to the JSP, I thought I'd use the action include or foward attribute which seems to accomplish this. But I can't make it work. Here is the struts-config entry... action path=/Registration forward=/registration.jsp /action I would expect that /Registration.do would open registration.jsp Instead I get '500 No action instance for path /Registration could be created' Any ideas? thx andy -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]