Re: Validation against database: Form or Action?
No, no database access in the action form - yech, bleh, ptui! :-) General principle: Form > Action > Business Layer > DAO > Database. Errors and messages from the lower layers can be handled via the Action.saveMessages() method, then exploited via the structures in the .jsp. hth, On 2/23/06, Scott Van Wart <[EMAIL PROTECTED]> wrote: > I have a number of scenarios where I need to validate against a set of > rows in a database table. For example, when logging in, it's all fine > and dandy to make sure a username and password is entered in the > ActionForm.validate method, but should database access go in the > ActionForm? If so, how do I return errors/messages back to the calling > page from within the Action.execute method? > > - Scott -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: write el equivilent
I think you need ${} around the whole expression. ${myBean.myNestedBean.displayData.property} On 2/17/06, Dennis Hoer <[EMAIL PROTECTED]> wrote: > Tried > > > and it resolves to a string > "myBean.myNestedBean.methodX" > > I also tried > > > > and get the same thing. I need the result of the string to be > resolved after the method name is returned. -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Another struts design question
That could work, and it would scale to n input pages. Thanks Mark! On 2/14/06, Mark Lowe <[EMAIL PROTECTED]> wrote: > You could use the referer header to create an action forward based on > that value. > > String referer = request.getHeader("Referer"); > URL url = new URL(referer); > String path = url.getPath(); > String contextPath = request.getContextPath(); > path = path.replaceFirst(contextPath,""); > > return new ActionForward(path,true); > > You may have to append any parameters to the path, but i'm sure you > can work that out.. > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Another struts design question
Greetings, I need to have an action return to a previous page depending upon which page originally requested the common page. Think of it as a settings page that can be accessed from multiple places. Like this: Entry 1 ---> Common Page <Entry 2 How can I tell the common page action to return to the correct requestor page? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing static methods from Struts/JSTL
> > Ok, since this app is internationalized, I'm guessing you have your > > .en, .fr, etc. files all ready to go? If I'm reading this right, it > > looks like your app needs an internationalization effort put into it? > > Maybe I misread. > > That is correct. As we cut over to Struts, we have been > internationalizing the messages, other template page text and text images. > > > > > Is there a reason you're not using the Applications.resources.(country > > code) files to do this sort of thing? Again, I'm probably missing > > something. > > I may not be doing this the right way. Simple messages live in our > ApplicationResources.properties file. Right now, we are only doing > english, which is the default. > > But, I didn't know what to do with more complex messages, which may be > multiple paragraphs, with HTML, images, links, etc. And may contain > Struts/JSTL tags too. So what we have done is created a directory in our > application: > > /messages/en/ > > In that directory, we place JSP files that contain the more complex > messages. In the ApplicationResouces.properties file, we specify a URL > to the file containing the complex message. Ok, I think you're making too much work for yourself. If I understand it(I8N) correctly, the only thing one really has to do is name all of those .properties files with the right country code, insert the translated text with the correct subsitution placeholders, and presto, the magic container will render the correct stuff for you. Then you get a pony :-) Mind you I'm recounting this from fuzzy memory so the last two sentences could be completely and totally inaccurate, but I'm pretty sure you get a pony... Manning's _Struts in Action_ has a pretty good chaper (13) on App localization. http://www.manning.com/books/husted/contents. Best of luck Keith! thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing static methods from Struts/JSTL
On 2/8/06, Keith Fetterman <[EMAIL PROTECTED]> wrote: > > OrderRulesBean.getSmallOrderFeeLimit() > > This static method is returning a property from a properties file that > will be included in a message to the user. This class provides a > convenient way for java classes to reference a single instance of this > property. > > From what you said, I could create a page display backing bean and > expose it through there. Good idea if it works. But, I was wondering if > there was a more general way without having to re-expose it. Well is it possible to just put this in as another property of what's being displayed on the page currently so that ${order.smallOrderFeeLimit} just delegates that call on the get to OrderRulesBean.getSmallOrderFeeLimit()? > > In my particular case, I might have a problem accessing the request > scoped page display bean. The message that I am displaying to the user > is located in an internationalized message (JSP) file that will be > imported to the page using tag after fetching the page URL > using tag to get the URL from the > ApplicationResources.properties file. I need to insert the value from > the static method in the text contained in the imported file. Ow, that made my head hurt :-) Ok, since this app is internationalized, I'm guessing you have your .en, .fr, etc. files all ready to go? If I'm reading this right, it looks like your app needs an internationalization effort put into it? Maybe I misread. Is there a reason you're not using the Applications.resources.(country code) files to do this sort of thing? Again, I'm probably missing something. > > Is there is a direct way to access the static method without fetching it > from request scoped variable or object? Another post said there is a > nonstandard Struts tag library that will work. FWIW, I'd stay away from those, but it might work for your situation. > BTW, what is best practice in Struts when providing data to JSP files? Good question, I know the technique I prefer is your #2 item below, but that might not be the best practice in your situation. > 1. Create a display backing bean that contains all of the objects that > will be used and store that in a single requested scoped variable? > > 2. Store individual objects and values in requested scoped variables? > thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Accessing static methods from Struts/JSTL
IMO this is a design smell of the presentation layer. My suggestion would be to refactor these items down to the 'business-layer' and then have your actions put the results of that layer into the form/display bean. Then the .jsp could just look like There may be more to this with your particular site, but that's a first off-the-cuff guess. hth, On 2/8/06, Keith Fetterman <[EMAIL PROTECTED]> wrote: > We are converting old JSP pages to Struts and JSTL and I am running into > a problem. On the old JSP pages, we have some calls to static methods > in scriptlets and runtime expressions. On the new JSP pages, we have > disabled scriptlets and runtime expressions. Here is an example: > > The old code will have an expression like: > <%= OrderRulesBean.getSmallOrderFeeLimit() %> > > What is the best way (best practice or easiest to implement) to access > static methods in the JSP pages without resorting to runtime expressions? -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSTL formatting for displaytag column
What you want is the following: On 1/26/06, fea jabi <[EMAIL PROTECTED]> wrote: > Have an object Account which has couple of attributes in it. > > using displaytag to show all the accounts. > > > > > > > > ... > > > > want to display the values in the column as $1000 or so. i.e prefix the > value with dolar sign. > > I am not sure what the value="${}" would be. > > accountcoll has List of Account objects. > > Thanks. > > _ > Don't just search. Find. Check out the new MSN Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Working with dates in Struts
Why not set a display variable in the action that serves that page? Then, in the jsp you can use to see if you need to display the date/message? I suppose you could also use the jstl el to determine the condition as well. Could you be a bit more explicit in what needs to be displayed? On 1/23/06, Priya Saloni <[EMAIL PROTECTED]> wrote: > Hi , > > I have a requirement using Struts where i need to show in the JSP if the * > paymentDate* is between *fromDate *and *toDate* Only.All Dates are * > java.util.Date* .Is there any way we can implement in Struts based > JSPs.Wecan implement it using java code but we don't want to do > that.Some one please advice me.Its very urgent(Production Issue). > > Thanks In Advance > > Priya > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: jstl tutorial/reference?
Here's a few links: http://today.java.net/pub/a/today/2003/10/07/jstl1.html http://www-128.ibm.com/developerworks/java/library/j-jstl0211.html http://java.sun.com/developer/technicalArticles/javaserverpages/faster/ http://www.onjava.com/pub/a/onjava/2002/08/14/jstl1.html - old, but useful. http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html - check out the jsp section of this massive tutorial BTW most of your issues will probably be around the el. Get familiar with that and you'll be good to go. Good luck, On 1/23/06, Deep Chand <[EMAIL PROTECTED]> wrote: > Hi, > > I'm developing a struts based application and would like to use jstl > tags instead of custom tags specified with struts tag lib. Is there a > good JSTL tutorial/reference available which gives good example usage > also of how to use the jstl tags. > > Thanks > Deep > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Making submenus with tiles
Greetings, I've google'd the web and I haven't found any good advice on how to make submenus with tiles. What I have is a menu structure like this Item1 subitem1 subitem2 Item2 subitem2 subitem2 ... How would I define this in a tiles-def? What I have so far is something that looks like this: However, this makes the iteration over the items ugly in the .jsp. Is there an easier/better way to get what I'm after? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: prepopulating a dropdown box in a struts way.
Mine are, because I do submits off of those pages. If you use a form, then the scriptlet logic you have can go into the action and you don't have that messy java code in your jsp. On 12/12/05, Leung Ping Cheung <[EMAIL PROTECTED]> wrote: > Should the jsp be tied to a form for this case? > > I do not make up a form. > I do this in the jsp. > <% > List availableSystemList = > UserSystemService.getInstance().getAvailableSystemList(request.getRemoteUser()); > request.setAttribute("availableSystem", availableSystemList); > %> > > > > > > where system_href is one of the attributes of availableSystem. -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: prepopulating a dropdown box in a struts way.
You need to make use of the html:optionsCollection tag In your form bean you need an object that has the properties label and value. Like this: public class ComboBoxItem implements Serializable, Comparable { private String label; private String value; // This is the contract for html:optionsCollection, label is what is // displayed on the form, and value is the code behind it. public ComboBoxItem(String label, String value) { this.label = label; this.value = value; } public String getLabel() { return label; } public String getValue() { return value; } public int compareTo(Object o) {...} Then, in your populate action, you'll set a Collection on the form. That should to it. On 12/8/05, Leung Ping Cheung <[EMAIL PROTECTED]> wrote: > I think there are many people asking the same question. But I cannot > find the answer. any web sites have more or less coding example of > populating a dropdown box or list in a Struts way before the web page > displays. > > Thanks > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Addressformat For Different Countries
If it were me, I'd use tiles to swap out body content at runtime based on the country code. A couple logic tags and a decent tile layout should work. On 12/6/05, Shiva Narayana <[EMAIL PROTECTED]> wrote: > Hi All, > > I have to implement address format depending on country in JSP. Like > > For Australia Line1, line2 ,Street,Code > For UK Code,Street,Line1,COuntry > For IndiaStreet,City,line1,country > > Likewise i have do display the label and text box based on the country. > Please help me how to do this in struts. > > Thanks in advance. > > -- > Regards > Shiva > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Returning to an unknown input page.
Greetings, I've got an page that can be accessed from multiple places on the webapp. Page 1 ---> Form Z <--- Page2 ^ | | Page 3 This page needs to be context sensitive when the user hits the 'cancel' button so that he/she is returned to the previous caller. Is there a standard way to make this sort of navigation work? I don't want to code items into for the form that are just to specify which page was the original caller. thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tiles/Action design question
On 11/16/05, Laurie Harper <[EMAIL PROTECTED]> wrote: > Keith Sader wrote: > I'm not sure exactly what you meant by 'polymorphism off of a submit' so > this might be completely off-base but... Passing the action into the > tile definition may be one option, depending on how your tiles and > actions are set up. Another option may be to wait for the Struts 1.3 > release that's coming up. 1.3 lets you have 'extends' relationships > between various configuration elements. I'm not sure, but I think this > includes tiles definitions, in which case you can have a tile for each > of your 'precedence levels' with each extending the higer-level one. > > If that doesn't sound like it might be useful, I probably haven't > understood what you want to achieve properly. Thanks for your input, but (as usual) I've found out what my real issue is. I was defining the element inside of the tile when the containing page needs to contain the form instead of the tile. I'm going to refactor the tile to be just the html elements and inputs that are common to all these pages and put the form in the containing page. What I was working on at first was but this wouldn't have worked on a submit so what I'll put in now is: Now I just need to eliminate some action duplication. thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tiles/Action design question
I've got a form that will be included in one of three pages. Essentially this form captures the same data at different levels in an inventory of rolling stock. The grouping is as follows: 1.) Inventory Defaults - applies to all inventory 2.) Fleet level defaults - applies to a group of inventory items 3.) Equipment defaults - applies to one piece of rolling stock. The order of precedence is 3, 2, 1 i.e. attribute data at the equipment level over-rides defaults set at the fleet level, defaults set at the fleet level over-ride inventory defaults. I've got a tile defined that captures the common data, and I was wondering if it was advisable to pass in the action to call on submit as a tile parameter? What I'd like ideally is polymorphism off of a submit. Is there an object friendly-way to do this? Can anyone point me in the right direction? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ignorant multibox question.
Have you stumbled on this link: http://husted.com/struts/tips/007.html I think it's almost verbatim out of the Struts in Action Book hth, On 11/11/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Lets say I have the following multibox: > > > > > > > > > > > > > > I have a List of POJOs with a name and a boolean value for each POJO. I want > to change the boolean value to true if a user check marks a specific item in > the List. > > If I wasn't in struts I could easily do this if I were using a Servlet. But > how and where do I read through each POJO in the List changing the POJO > instance variable to true if someone check marks it? -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:forEach does not recognize HashSet when combined with nested EL ?
Sorry, I was reading off of the cuff - my mistake. Let me look at this again... On 11/1/05, Raghu Kanchustambham <[EMAIL PROTECTED]> wrote: > Hi Keith, > Thanks for responding. > However, How will this solve my problem? The problem is that the control is > not entering into the loop in the first place. And you have put additional > statements in the loop body. I have anyways tried it, and it did not work. > Regards, > > > Please look at the following code: > > > method of inspecting what's happening with your .jsp. > > > <% > > > DynaActionForm dynaForm = (DynaActionForm) request.getAttribute > > > ("studentEnrollmentForm"); > > > StudentEnrollment se = (StudentEnrollment) dynaForm.get > > > ("studentEnrollment"); hth, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: c:forEach does not recognize HashSet when combined with nested EL ?
You need to tell your loop to use the key or the value from your set. ... that should fix it up. On 11/1/05, Raghu Kanchustambham <[EMAIL PROTECTED]> wrote: > Hi, > Please look at the following code: > > > studentEnrollment is a bean that I have attached to the DynaActionForm that > is configured. That bean has a Set called paymentDetails. > I intend to iterate over this HashSet and its just not working. Its not even > entering the loop. > A little hack that makes the above work however is when I write extra (less > elegant code) like: > > <% > DynaActionForm dynaForm = (DynaActionForm) request.getAttribute > ("studentEnrollmentForm"); > StudentEnrollment se = (StudentEnrollment) dynaForm.get > ("studentEnrollment"); > > Set paymentDetails = se.getPaymentDetails(); > request.setAttribute("paymentDetails",paymentDetails); > %> > > 1) this code is in-elegant > 2) While the loop is being entered, when this form is being "submitted" to > the action class, any details attached to text boxes for each > 'paymentDetails row' is not being passed back anyways! :( > Can someone tell me what I am conceptually wrong. I am relatively new to > using Struts. > Thanks in Advance. > Raghu hth, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Forcing JSP reloading, avoiding IE caching of it
You can't really force the browser to do anything, but you can hint it with the following: http://www.jguru.com/faq/view.jsp?EID=377 best of luck, On 10/21/05, C.F. Scheidecker Antunes <[EMAIL PROTECTED]> wrote: > Hello all, > > I have a struts app that works great on Firefox, however when I use IE I > have problems with it. > I guess that IE caches the JSP page. So when the action sends the data > to the JSP I always have the same > thing. > > So I read about it and found that if you add on the struts-config.xml > it would > solve the issue. Well it does not solve it in its entirely. > > I would like to ask if I could have something on the JSP or the HTML > part of it to force reloading by IE. > Any suggestions? > > Thanks, > > C.F. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Show validation errors in a frame
Greetings I've an iframe embedded in a .jsp. The iframe contents are another set of .jsps that contain a form submit (the reason we've done it like this is so that the embedded iframe looks like a tabbed diallog). When I submit the iframed form, I'd like to display the errors on the containing page, and highlight the offending field in the iframe via the errorStyleClass on the tag. I can the errors to show up on the containing jsp, but I can't figure out how to trick the iframed jsp to highlight the incorrect fields. Does anyone have a suggestion? thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction with html:image
After googling some more, it seems as though there's no 'elegant' way of doing what seems simple on the surface in terms of swapping two tags. I think I'm just going to wind up using the ImageButtonBean work-around. Thanks for the links! On 10/20/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > http://www.michaelmcgrady.com/button/jsp/dispatch_action.jsp > http://issues.apache.org/bugzilla/attachment.cgi?id=15762 > http://struts.sourceforge.net/strutsdialogs/selectaction.html > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction with html:image
I'm trying to use the LookupDispatchAction with the html:image tags so that I can have spiffy looking buttons, however I get this error: INFO: Exception thrown Request[/Foo/SaveDefaultSettings] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. What seems to be happening is that if I use a regular html:submit tag it works fine, but due to the position information that goes along with the html:image tag it's messing up the parameter submit. Is there a way around this? I've tried setting the value parameter on the html:image to be the same as the value parameter that is sumitted on an html:submit and that doesn't work :-( thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Declarative exception handling behaving wierdly.
I'm trying to experiment with declarative exceptions. When I add a global handler that deals with java.lang.Exception, I get redirected to my global error page as I expect. However, when I add an action specific handler, I still get directed to the global page instead of to the action specific page. The docs indicate that the action specific handler will take precedence over the global handler, but I don't observe this happening. Has anyone else had this issue? Action class excerpt: my.search.SearchAction public ActionForward execute(...) { throw new my.search.SearchException("SearchException"); } Here's an excerpt of my struts-config.xml ... thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Hibernate object relational mapping
For 95% of your application, this won't be a problem. It's the 5% that you will have to take out of the persistance layer and tune that will be where your optimization of they query will be required. On Thu, 10 Feb 2005 10:40:52 -0500, Brian McGovern <[EMAIL PROTECTED]> wrote: > Don't get me wrong, i wasn't knocking it. But my main concern is app speed > difference using stored procs or hibernate. > > -Original Message- > From: Lee Harrington [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 10, 2005 10:10 AM > To: Struts Users Mailing List > Subject: Re: Hibernate object relational mapping > > I use hibernate...it's not a "tool for those who don't know sql" -- as > I've been a database developer for 20+ years. > > It's a tool for those who: > 1. don't want to have to write a lot of redundant code just to > insert, update, delete > 2. don't want to have to hand code "class.property = > recordset.getField("fieldName")" out the yin yang > 3. don't want to have to hand code different data layers for > different database systems > > Consider on form submit > > You could write: > > sqlStr = "insert into mytable (field1, field2.field15') values (" + > form.field1 + ",'" + > form.field2 + "','" + > . > form.field15 + "')" > > and write your own handling of database errors > > or could write: > > // copy form variable to an instance of your data class > BeanUtils.copyProperties(metric,dynaForm); > > // Call to "persist" (save) the record > MetricService.getInstance().makePersistent(metric); > > And there are MANY more reasons to use Hibernate over handcoding your > own sql. None of it having to do with "not having to know sql". > > Lee > > ----- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]