Re: How to pass Session variable to different Webapplication?
You can also use JMS to pass an object through a messaging queue. OpenJMS is an open source JMS Engine that works well for me. I have not played with to many of them to know if there is a better one out there (for free). All of the major Application servers (BEA, WebSphere, etc) support the JMS spec. Martin Burkert [EMAIL PROTECTED] Martin Burkert [EMAIL PROTECTED] 09/17/2005 07:06 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: How to pass Session variable to different Webapplication? On Fri, 2005-09-16 at 16:20 -0700, Wendy Smoak wrote: How are the users logging in? You need some form of 'single sign on,' but how to go about it depends on where the credentials are coming from. thx for answering! I'm using JAAS to logon the user. The JAAS-subject is containing the users name and credentials. Craig McClanahan wrote, that I would violate the spec. Is there a design pattern to solve this problem in a nice way without violating the spec? - or an other question: how is it possible to split up a big struts application into small pieces? thx for any hint greetings Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Who decides?
Just to put in my 2 cent worth, I am not sure your point is 100% valid. True, languages and technology is changing daily and what you learn today is worthless in 10 years from a coding language standpoint, but being a senior developer or architect is very different than being a coder. Some key things that are learned from experience: 1. Just because a new technology is hot in the industry, it is not necessarily right for your organization. Many young talented developers will attempt to change the environement to what they are comfortable with, not what is the best fit for the company. I have seen a lot of good developers attempt to write php or _javascript_ functions because they know how, but do not consider what the impact of that decision is. What is the impact on the server? What is the impact on the client? How maintainable is it if they move to a different projeect? etc. 2. Depending on the background of the developer, many younger (I sound old) developers may not have been exposed to the various stages of the production life cycle. They may work well on new projects, but not work well under the pressure of a major production outage. Others may have spent years developing updates to legacy systems which and not been exposed to new development. Adding one of these developers to a new project, most will attempt to impose what they know on the problem and not look at what is best. 3. New technology geeks (self imposed title), often know a technology or a suite of technologies. They are truely excellent programmers, but do not understand business. (Welcome to the 2000 .bom explotion). Just because something is a great idea, does not mean that it is a good business decision. Just because you can do something, does not mean that you should. User interface design, Business Process Optimization, Change Management, these are soft skills that are required for a lot of companies. 4. When looking for senior level developers, architects, etc, you need a developer that has been exposed to more than just one method of development or one environment. Someone who truely knows that there are many ways to solve a problem and knows how to find the right implementation. They need to be able to think for themselves, not just code to what they know or want to know. Yes technology changes, but good practices, design knowledge, and research skills are all tools that are developed over time. Rick Reumann [EMAIL PROTECTED] Rick Reumann [EMAIL PROTECTED] 09/12/2005 02:26 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Who decides? Brandon Mercer wrote the following on 9/12/2005 2:11 PM: Building a web interface with a database backend isn't innovative it is mearly being implemented to solve a particular businesses need. That's exactly my point though. Once you understanding the basics, the learning is then in the new implementations of things ( you going to use EJBs, hibernate, iBATIS?). You going to use JSF, WebWorks, Struts, Tapestry? What's a bit annoying is having to figure out what to pick to learn. It's sort of like gambling on what will be the next 'hot' thing employeers will look for. Stupid really. An employeer shouldn't care so much what you know 'now' but what you have the potential to learn down the road. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Prepopulating DynaValidatorForm and validating
I have handled this in two different ways. 1. Previously I had a preprocess action which populated the collection and that was all it did. In the struts-config, I set the preprocessAction.do as the input page. That way if the validation failed, struts will execute the preprocessAction which will repopulate the list and redisplay the form in tact. 2. Resently, I have been using DWR (Ajax) project to load the select list when the page is rendered. I do this because my list is dynamic and can change based on selections that the user enters on the page. [EMAIL PROTECTED] [EMAIL PROTECTED] 09/07/2005 05:20 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Prepopulating DynaValidatorForm and validating Hi all! Googling and seraching the archive did not solve my problem, so I will have a try. In my struts-config.xml, I have defined a DynaValidatorForm and an action: form-bean name=editForm type=org.apache.struts.validator.DynaValidatorForm form-property name=projectList type=java.util.Collection/ form-property name=version type=java.lang.String initial=/ /form-bean action path=/processEdit type=com.materna.buc.buildmanager.actions.ProcessEditAction scope=request name=editForm validate=true input=/WEB-INF/jsp/edit.jsp ... /action As you can see, this form holds a list of projects in a collection, which has to be populated before the corresponding jsp-page is shown. So I have an Action which gets the (dynamic, not static) list of projects from a database and puts it into the editForm like this: public ActionForward execute( ... ) { DynaValidatorForm dynaForm = (DynaValidatorForm) form; // get list of projects from database Collection projectList = getDatabaseHandler().getProjectList(); // put project list into DynaValidatorForm dynaForm.set( projectList, projectList ); Everything works fine after showing my jsp-page with a combobox populated with the data from my projectList - the user can choose one project. But on the same page there is a html:text field: html:text name=editForm property=version value=1.0 size=7 / which corresponds to my editForms version-property. When the user submits the form to processEdit, the version property has to be validated to see if it is not empty. So in my validation.xml I do the following: form name=editForm field property=version depends=required arg0 key=edit.version / /field /form If the user submits an empty version and validation fails, he will be send back to the jsp-page, but it will not show because the project list is not present any more. That seems clear because the DynaValidatorForm is reset when the user submits. I tried following workarounds: 1. I replaced the DynaValidatorForm with my own version overwriting the reset - method to do nothing. Additionaly set the scope to session. But my project list gets still lost (wondering why?) 2. Trying to pass my project list from one form to the other like this html:hidden name=editForm property=projectList value=projectList in all variations always had to fail because the project list will be send as a string and therefore can not be converted back to a collection. I considered to put my project list into application scope, but as it is dynamic, large and not the only (dynamic and large) list to be shown on my jsp-page (I only used it as an example in order not to complicate my question), I am not sure if it is the right way. And writing an ActionForm with own validation and reset methods is a lot of work and would not use the benefits of a DynaValidatorForm... So if you know a trick, solution or workaround, please help! Thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: request attribute in jsp - please advice
if you store the request attribute in a hidden field on the screen, when the page is submitted the field will be put back into the request. Otherwise, you will need to move the field to the session where it will not be cleared when the request is invalidated after the JSP is displayed. Rivka Shisman [EMAIL PROTECTED] Rivka Shisman [EMAIL PROTECTED] 09/06/2005 12:27 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject request attribute in jsp - please advice Hello friends I have an EditStudent.jsp page in which I have a form. Before the form tag I get a request attribute called 'listIndex'. But, when my validate() method fails on field validation it returns back to the above mentioned jsp page with an appropriate message. That is o.k. - the problem is that this causes the removal of the request attribute that was originally set by the EditStudentAction. So what I do now in the jsp page is something like this: % int listIndex = 0; If (request.getAttribute(index) != null){ listIndex = request.getAttribute(index); }else{ If (request.getParameter(myIndex) != null){ listIndex = request.getParameter(myIndex); } % And then under the html:form I have an hidden input like: INPUT type=hidden name=myIndex value=% =listIndex% When the validate{} fails the - getParameter(myIndex) - enables me to restore my request attribute via the hidden parameter. Do you know a nicer way to do it? Thanks Rivka - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Select Options Question
I am sure there is a slick way to do this, but it escapes me at the moment. I have a Select Box that I am populating with the html:options tag The result is: select name=cmbGroup id=groupList option value=jk12341Group 1/option option value=34t1fv1Group 2/option option value=32fq21Group 3/option ... /select I need the value for DAO actions performed from the search which will return a detail bean for display on an output JSP. On the output JSP I need to Display the Group Name that I selected from the input. My Form holds the group id and a field for the group name. The options that I can see are: 1. Requery the Database for the output page to retrieve the name given I have the key. This would work, but seems like a lot of overhead to go to the database each time. 2. Create a delimited value (ie option value=jk12341, Group 1Group 1/option) and use the String Split to get the value and label. (I am leaning toward this) 3. use javascript to update the field each time the select changes. The problem with this is that the select box can be very large based on the users selections on previous entries. 4. Store the Value Label list in the session (Don't like this at all because the volume of users that will use this application). Any other suggestions?
Re: Select Options Question
On the result page I only need the Label for the selected option. Not the entire list. The problem is that when you submit the form, you only submit the value in the form object and loose the label. I need to pass the label as well so that I do not have to requery for it. The way that i have it currently is that the value contains a comma delemited string containing both the label and key (overkill on the bandwidth I know). In my action class, I do a string.split on the comma and pass the first value to my DAO processor and the Second value I put in my form for display. It is the only way I could think of without iterating through the options or storing the initial results which populate the option list. Frank W. Zammetti [EMAIL PROTECTED] Frank W. Zammetti [EMAIL PROTECTED] 09/01/2005 11:28 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Select Options Question I'm not sure I understand... do you just need to have the group name when you display the detail for the selected item, or do you need the entire select list (to avoid getting it from the datavase each time?) If you just need the grou pname, could you simply put the group name in session? May or may not work depending on the flow of your app, but it would be a nice, simple solution if it'll work... just remember to clear it out at an appropriate time. The other option that comes to mind immediately is indeed to use _javascript_... seems like all you'd need is a form with two hidden fields, groupName and value... onChange of the select, populate those two fields and submit() the form. You'd then have both pieces of information to render your detail page. Or maybe I don't understand the problem? Frank [EMAIL PROTECTED] wrote: I am sure there is a slick way to do this, but it escapes me at the moment. I have a Select Box that I am populating with the html:options tag The result is: select name=cmbGroup id=groupList option value=jk12341Group 1/option option value=34t1fv1Group 2/option option value=32fq21Group 3/option ... /select I need the value for DAO actions performed from the search which will return a detail bean for display on an output JSP. On the output JSP I need to Display the Group Name that I selected from the input. My Form holds the group id and a field for the group name. The options that I can see are: 1. Requery the Database for the output page to retrieve the name given I have the key. This would work, but seems like a lot of overhead to go to the database each time. 2. Create a delimited value (ie option value=jk12341, Group 1Group 1/option) and use the String Split to get the value and label. (I am leaning toward this) 3. use _javascript_ to update the field each time the select changes. The problem with this is that the select box can be very large based on the users selections on previous entries. 4. Store the Value Label list in the session (Don't like this at all because the volume of users that will use this application). Any other suggestions? -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Passing variable to javascript function
You can also use JSTL Notation. bean:define id=myVar name=form property=field/ html:link action="" name=deleteDataParams scope=page validateDelete('${myVar}') Leon Rosenberg [EMAIL PROTECTED] Leon Rosenberg [EMAIL PROTECTED] 08/29/2005 06:39 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject RE: Passing variable to _javascript_ function Unfortunately it's not so easy, because you can't use a tag as an attribute to the tag. html:link action="" name=deleteDataParams scope=page validateDelete(bean:write name=data/) This can't work, because the attribute (onclick) will not be evaluated. There could be two possible solutions. First, leave the html taglib and drop back to normal a href... Second: store the variable value in a _javascript_ variable: script var myData = 'bean:write name=data/'; /script html:link action="" name=deleteDataParams scope=page validateDelete(myData) Of course this only works if you have the value of myData at page generating time. If the value is changed by something the user does on page, like checking a checkbox, i would store it in a hidden field in the form and read per _javascript_ in validateDelete(), like this: for (var i=0;i document.formname.elements.length;i++){ var e = document.formname.elements[i]; if (e.value == 'set' e.checked==true){ doSubmit=true; myData = e.value; } } the above _javascript_ is only an example how to iterate over form fields with _javascript_, it has not the required functionality. regards Leon On Mon, 2005-08-29 at 14:28 +0530, Anjishnu Bandyopadhyay wrote: Hi Anuradha, I think this will work: validateDelete('bean:write name=abc/') where abc is the java variable that you put in request/session. With best regards, Anjishnu. -Original Message- From: Anuradha S.Athreya [mailto:[EMAIL PROTECTED] Sent: Monday, August 29, 2005 2:26 PM To: [EMAIL PROTECTED] Apache. Org Subject: Passing variable to _javascript_ function I had posted this problem a few days back, but I couldn't find a solution to this. So I'm posting this again, since I need to implemen this urgently. script function validateDelete() { return confirm(Delete Data); } /script html:link action="" name=deleteDataParams scope=page validateDelete() Delete Data /html:link To the validateDelete() _javascript_ function, I want to pass a java variable. How do I do it? Once I pass the variable, my _javascript_ function has to be : script function validateDelete(data) { return confirm(Delete Data+data); } /script CAUTION - Disclaimer * This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system. ***INFOSYS End of Disclaimer INFOSYS*** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: core struts -- best practise fundementals
For the most part you are correct. However, it is a little more straight forward than that. Logic should be wrappered in a logic object. The Tag Library can bridge the presentation to this generic logic. This is so that the generic logic can be used universally from either a presentation screen or from another logic object that needs the same functionallity. This is good practice because it allows you to write the code once and reuse it in many places. This saves on memory, Maintenance time, Development time, etc. The reason you want to extract presentation from logic, is because many companies rebrand themselves often on the internet. New look and feel keeps thing nice and fresh, but is a nightmare if you have to rewrite your applications just to take on a new layout. Additionally, after a site is released, you often find the users do not use the application as you expected during development. By rearranging the screen layout and application flow, you can make the users more productive and generally happier. If you tie your logic to your screen this becomes much more complex. The key to any object oriented language is to develop small compartmentalized objects. These objects should focus on just the functionallity it needs to complete its task. A fell defined set of interfaces should handle getting the information to and from the little back box. This is where Struts, Taglibraries, JSF, etc come into play. peru cheppanu [EMAIL PROTECTED] peru cheppanu [EMAIL PROTECTED] 08/29/2005 12:41 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject core struts -- best practise fundementals Hi all, I am trying to understand the motivation behind seperation of logic and presentation in struts framework. I was wondering if any of you can provide some light if I am thinking in right direction. Now, if you write scriptlets in JSP, that is a bad practice.., however if you hide that functionality in a tag class and implement that tag like struts tags or any other tags.. thats a good practice. For example, I want to send a concatenated string instead of a hashmap to display as per key-value relationship. I meant send [EMAIL PROTECTED] string rather than a hashmap and want to parse it for display. If I write a scriptlet that I use to substring and display only that user is concerned with -- that is bad practice. If I use a tag lib that looks more like logic:substring name=hashArr digits=4, -- good. Am I getting this whole thing wrong? Pls excuse if I sound too stupid and this is my first post here.. --Ashrita - Yahoo! Mail for Mobile Take Yahoo! Mail with you! Check email on your mobile phone.
Re: How can I refer a control in javascript which hava a . in its name
html:text name=myForm property=myobject.subobject styleId=subobject .../ then get the field by using document.getElementById(subobject); Tony Smith [EMAIL PROTECTED] Tony Smith [EMAIL PROTECTED] 08/18/2005 01:07 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject How can I refer a control in _javascript_ which hava a . in its name Hi everyone: Here is my jsp: html:form ... html:select ... > ... /html:select html:text name=myForm property=myobject.subobject .../ /html:form If user change the selection in the select, I would like to change the content of the text. Thus, I write my change() function in _javascript_: script language=_javascript_ function change(select){ document.form[0].myobject.subobject = select.options[select.selectedIndex]; } But looks like this does not work. The problem is the name of the text. In the html it is myobject.subobject. But seems that _javascript_ does not take that How can I refer the text in _javascript_? Thanks, Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: How can I refer a control in javascript which hava a . in i ts name
Be aware that document.all is IE specific. [EMAIL PROTECTED] [EMAIL PROTECTED] 08/18/2005 06:43 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject RE: How can I refer a control in _javascript_ which hava a . in i ts name Try this: document.all['myForm'].value __ Senior Programmer Analyst, Tax Distributed Systems Development Tax Compliance Development, ADP IT Phone: (909) 592-6411 Ext. 3863 e-mail: [EMAIL PROTECTED] -Original Message- From: Jeff Beal [mailto:[EMAIL PROTECTED]] Sent: Thursday, August 18, 2005 1:26 PM To: Struts Users Mailing List Subject: Re: How can I refer a control in _javascript_ which hava a . in its name You also have the option of doing document.form[0]['myobject.subobject']. On 8/18/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: html:text name=myForm property=myobject.subobject styleId=subobject .../ then get the field by using document.getElementById(subobject); Tony Smith [EMAIL PROTECTED] Tony Smith [EMAIL PROTECTED] 08/18/2005 01:07 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject How can I refer a control in _javascript_ which hava a . in its name Hi everyone: Here is my jsp: html:form ... html:select ... > ... /html:select html:text name=myForm property=myobject.subobject .../ /html:form If user change the selection in the select, I would like to change the content of the text. Thus, I write my change() function in _javascript_: script language=_javascript_ function change(select){ document.form[0].myobject.subobject = select.options[select.selectedIndex]; } But looks like this does not work. The problem is the name of the text. In the html it is myobject.subobject. But seems that _javascript_ does not take that How can I refer the text in _javascript_? Thanks, Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, notify the sender immediately by return email and delete the message and any attachments from your system. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Passing a DynaForm in a URL inputStream
Sorry for the off topic post, I have a case where I am generating a struts form and placing it into a session. I am having to create a inputStream based on a URL of a JSP which uses the form, but the JSP cannot find the form in any scope. Does the URL use a different request/session than the action that is creating it? If so, does anyone know of a way to pass the dynaform to the URL? Example code: JSP: Hello bean:write name=myForm property=userName ActionClass public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { if(null != form){ callFunction(new URL(http://localhost/helloworld.jsp;)); } return null; }
Re: [OT] Passing a DynaForm in a URL inputStream
OK, Found an answer for anyone who is interested, If not delete :) URL url = "" URL(http://localhost/helloworld.jsp); URLConnection conn = target.openConnection(); conn.addRequestProperty(METHOD, POST); conn.addRequestProperty(Cookie, JSESSIONID=+sessionId); conn.connect(); BufferedReader in = new BufferedReader( new InputStreamReader( conn.getInputStream() ) ); String inputLine; StringBuffer pageContent = new StringBuffer(); while ( ( inputLine = in.readLine() ) != null ) { pageContent.append( inputLine ); } in.close(); [EMAIL PROTECTED] [EMAIL PROTECTED] 08/17/2005 03:04 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject [OT] Passing a DynaForm in a URL inputStream Sorry for the off topic post, I have a case where I am generating a struts form and placing it into a session. I am having to create a inputStream based on a URL of a JSP which uses the form, but the JSP cannot find the form in any scope. Does the URL use a different request/session than the action that is creating it? If so, does anyone know of a way to pass the dynaform to the URL? Example code: JSP: Hello bean:write name=myForm property=userName ActionClass public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { if(null != form){ callFunction(new URL(http://localhost/helloworld.jsp)); } return null; }
Re: Can nested tile layouts be done?
It can get a little difficult to keep up with. Basically, you have to know the Hierarchy of your tile and call the top most one. In this case, you would call .base which would intern call myEndUserPage.page1 and finally myEndUserPage.jsp. to change to another.jsp you would call .anotherPage in your action forward. Nesting tiles can be very useful when switching components of a tile, but can quickly become a headache when changing tiles in both layouts. I use the nested for menus only and have been debating on switching to struts menu because of the complexity. The only thing that has prevented me from doing this is waiting to see if I can jump to JSF or AJAX/D-HTML instead. Daniel Hannum [EMAIL PROTECTED] Daniel Hannum [EMAIL PROTECTED] 08/15/2005 04:55 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Can nested tile layouts be done? Thanks, I think this is better. I still must be missing something about how Tiles works internally, though. In my app, the tiles definition for the end user page (the one that defines body) is called endUserPage.tiles and Tiles is smart enough to handle requests for endUserPage.jsp in the correct tiled way. You have this arranged differently, where the end user page definition has a more cryptic name (.myEndUserPage.page1) and is referenced by .base. If I do it your way, then, how does Tiles know which URL to map to the tile layout we just produced? I just implemented my layout the way you've described, but now I don't know what URL to request because tiles-config.xmlno longer contains URLs. Thanks for your help Dan On 8/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: OK, I see: Your definition would need to extend .sublayout.. /layout/layout /layout/layout2 definition name=.base page=/layout/layout.jsp put name=section1 page=menu.jsp put name=section2 page=.myEndUserPage.page1 /definition definition name=.anotherPage page=.base put name=section2 page=.myEndUserPage.page2 /definition Definition name=.sublayout page=/layout/layout2.jsp put name=head page=xyz.jsp put name=body page=123.jsp /definition definition name=.myEndUserPage.page1 extends=.sublayout put name=body value=/myEndUserPage.jsp/ /definition definition name=.myEndUserPage.page2 extends=.sublayout put name=body value=/another.jsp/ /definition [image: Inactive hide details for Daniel Hannum [EMAIL PROTECTED]]Daniel Hannum [EMAIL PROTECTED] *Daniel Hannum [EMAIL PROTECTED]* 08/15/2005 03:51 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Can nested tile layouts be done? This still isn't working for me. I need to tweak your example because the value of body changes for each page. So if I add one more definition to my tiles-config.xml for an actual end-user page that a user would point a browser to: definition name=/myEndUserPage.tiles extends=.base put name=body value=/myEndUserPage.jsp/ /definition It's not clear which of your definitions I should extend. If I extend .base (the logical choice), I get the same behavior where the layout.jsp is rendered and layout2.jsp is substituted in, but no substitutions are made inside the layout2.jsp. If I extend .sublayout, I get even weirder behavior where it appears to render layout2.jsp but makes no substitutions at all. I looked at the Tiles examples and they don't seem to define individual pages in the tiles-config.xml, as I did above. Could that be my problem? Dan On 8/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yes, this can be done. The VBox example is a good example of this. Basically it is laid out as follows. /layout/layout /layout/layout2 definition name=.base page=/layout/layout.jsp put name=section1 page=menu.jsp put name=section2 page=.sublayout /definition Definition name=.sublayout page=/layout/layout2.jsp put name=head page=xyz.jsp put name=body page=123.jsp /definition you can then substitute out different components of each section based on what you are doing. [image: Inactive hide details for Daniel Hannum [EMAIL PROTECTED]]Daniel Hannum [EMAIL PROTECTED] *Daniel Hannum [EMAIL PROTECTED]* 08/15/2005 02:18 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Can nested tile layouts be done? Hi everyone, I have a question about nesting layouts with Struts tiles. I've seen this sort of thing discussed in the past, but in searching I didn't see an example that I could apply to my situation, nor did I see a good solution. Executive summary: What I want to do is have a simple
Re: Can nested tile layouts be done?
Yes, this can be done. The VBox example is a good example of this. Basically it is laid out as follows. /layout/layout /layout/layout2 definition name=.base page=/layout/layout.jsp put name=section1 page=menu.jsp put name=section2 page=.sublayout /definition Definition name=.sublayout page=/layout/layout2.jsp put name=head page=xyz.jsp put name=body page=123.jsp /definition you can then substitute out different components of each section based on what you are doing. Daniel Hannum [EMAIL PROTECTED] Daniel Hannum [EMAIL PROTECTED] 08/15/2005 02:18 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Can nested tile layouts be done? Hi everyone, I have a question about nesting layouts with Struts tiles. I've seen this sort of thing discussed in the past, but in searching I didn't see an example that I could apply to my situation, nor did I see a good solution. Executive summary: What I want to do is have a simple layout containing two tiles, both of which are JSP's. However, one of those JSP's is actually another layout JSP, which itself contains tile placeholders. I can get Struts Tiles to do the substitutions for the first layout, but it seems to treat my second layout as a simple JSP and does not do further tiles substitutions in the second layout. Detailed description: We have two separate applications that share a common track bar at the top of the screen. Beyond that they are completely separate. So, we have a layout containing trackbar and trackcontent. Trackbar is a common jsp as you can see below. Trackcontent is simply a blackbox representing the rest of the app. definition name=.base page=/layout/layout.jsp put name=trackbarvalue=/common/trackbar.jsp/ /definition Then I made two definitions that put in the appropriate subsititution for trackcontent. *BUT* note that both of those JSP's have their own Tiles placeholders called menu and body. It's necessary to do this because the apps may have different layouts but they must share the trackbar above. definition name=.app1base extends=.base put name=trackcontentvalue=/layout/app1Layout.jsp/ /definition definition name=.app2base extends=.base put name=trackcontentvalue=/layout/app2Layout.jsp/ /definition Then, since all the pages of a single app share an app-specific menu, I made another definition put the right page in for menu definition name=.app1 extends=.app1base put name=menuvalue=/common/app1NavBar.jsp/ /definition definition name=.app2 extends=.app2base put name=menuvalue=/common/app2NavBar.jsp/ /definition Lastly, we have two actual pages that extend the app definitions and put the right values in for body definition name=/app1page1.tiles extends=.app1 put name=body value=/app1page1.jsp/ /definition definition name=/app2page1.tiles extends=.app2 put name=body value=/app2page1.jsp/ /definition Now, when I put all this together and point my browser at, say, app1page1, I get the top-level layout and the trackbar rendered, and it renders the appropriate trackcontent for app1, but it does NOT do the second level of substitutions (i.e. substitute the correct menu and body) Is Struts capable of doing this sort of two-level layout indirection? If so, how should I change my tile defs and layouts to make it work. Thanks a lot! Dan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can nested tile layouts be done?
OK, I see: Your definition would need to extend .sublayout.. /layout/layout /layout/layout2 definition name=.base page=/layout/layout.jsp put name=section1 page=menu.jsp put name=section2 page=.myEndUserPage.page1 /definition definition name=.anotherPage page=.base put name=section2 page=.myEndUserPage.page2 /definition Definition name=.sublayout page=/layout/layout2.jsp put name=head page=xyz.jsp put name=body page=123.jsp /definition definition name=.myEndUserPage.page1 extends=.sublayout put name=body value=/myEndUserPage.jsp/ /definition definition name=.myEndUserPage.page2 extends=.sublayout put name=body value=/another.jsp/ /definition Daniel Hannum [EMAIL PROTECTED] Daniel Hannum [EMAIL PROTECTED] 08/15/2005 03:51 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Can nested tile layouts be done? This still isn't working for me. I need to tweak your example because the value of body changes for each page. So if I add one more definition to my tiles-config.xml for an actual end-user page that a user would point a browser to: definition name=/myEndUserPage.tiles extends=.base put name=body value=/myEndUserPage.jsp/ /definition It's not clear which of your definitions I should extend. If I extend .base (the logical choice), I get the same behavior where the layout.jsp is rendered and layout2.jsp is substituted in, but no substitutions are made inside the layout2.jsp. If I extend .sublayout, I get even weirder behavior where it appears to render layout2.jsp but makes no substitutions at all. I looked at the Tiles examples and they don't seem to define individual pages in the tiles-config.xml, as I did above. Could that be my problem? Dan On 8/15/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yes, this can be done. The VBox example is a good example of this. Basically it is laid out as follows. /layout/layout /layout/layout2 definition name=.base page=/layout/layout.jsp put name=section1 page=menu.jsp put name=section2 page=.sublayout /definition Definition name=.sublayout page=/layout/layout2.jsp put name=head page=xyz.jsp put name=body page=123.jsp /definition you can then substitute out different components of each section based on what you are doing. [image: Inactive hide details for Daniel Hannum [EMAIL PROTECTED]]Daniel Hannum [EMAIL PROTECTED] *Daniel Hannum [EMAIL PROTECTED]* 08/15/2005 02:18 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Can nested tile layouts be done? Hi everyone, I have a question about nesting layouts with Struts tiles. I've seen this sort of thing discussed in the past, but in searching I didn't see an example that I could apply to my situation, nor did I see a good solution. Executive summary: What I want to do is have a simple layout containing two tiles, both of which are JSP's. However, one of those JSP's is actually another layout JSP, which itself contains tile placeholders. I can get Struts Tiles to do the substitutions for the first layout, but it seems to treat my second layout as a simple JSP and does not do further tiles substitutions in the second layout. Detailed description: We have two separate applications that share a common track bar at the top of the screen. Beyond that they are completely separate. So, we have a layout containing trackbar and trackcontent. Trackbar is a common jsp as you can see below. Trackcontent is simply a blackbox representing the rest of the app. definition name=.base page=/layout/layout.jsp put name=trackbar value=/common/trackbar.jsp/ /definition Then I made two definitions that put in the appropriate subsititution for trackcontent. *BUT* note that both of those JSP's have their own Tiles placeholders called menu and body. It's necessary to do this because the apps may have different layouts but they must share the trackbar above. definition name=.app1base extends=.base put name=trackcontent value=/layout/app1Layout.jsp/ /definition definition name=.app2base extends=.base put name=trackcontent value=/layout/app2Layout.jsp/ /definition Then, since all the pages of a single app share an app-specific menu, I made another definition put the right page in for menu definition name=.app1 extends=.app1base put name=menu value=/common/app1NavBar.jsp/ /definition definition name=.app2 extends=.app2base put name=menu value=/common/app2NavBar.jsp/ /definition Lastly, we have two actual pages that extend the app definitions and put the right values in for body definition name=/app1page1.tiles extends=.app1 put name=body value=/app1page1.jsp/ /definition definition name=/app2page1.tiles extends=.app2 put name=body value=/app2page1.jsp/ /definition
Re: Nice try (was Java code generator including Struts 1.2)
I have used code generators in the past. True they can save initial development time, but many have serious short comings. (Not that this one does as I know nothing about it, but in general.) 1. The code is lowest common denominator code. Meaning that the generated code could typlically be optimized for the specific situation that it is generated for. 2. Depending on the programatic structure of the generator, the code can be very difficult to read for future maintenance. 3. Management often mistakes having a code generator can replace experianced programers and save big $$$. What usually happens is that the more the company invests in generated code, the less the developers know, the poorer the application design, the more you need experianced programmer to tell you why you are having performance problems. (The same argument can be made for intellegent IDE's which is really all a code generator is). 4. The generator itself can outdate itself very quickly, locking you into old technologies. For example, this email indicated struts 1.2, which version? 1.2.3, 1.2.7? Also, is this for java 1.5, 1.4, 1.3? Companies the size of IBM, Borland, Sun or open source sites like Jakarta have the resources to keep their software/frameworks up to date with technology, startup companys or school projects don't have that luxury. So, where I like the Idea of a generator for speed, I have difficulty accepting the cost. Martin Gainty [EMAIL PROTECTED] Martin Gainty [EMAIL PROTECTED] 08/10/2005 12:22 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Nice try (was Java code generator including Struts 1.2) Jinpeng- I think code generators could be a 'good thing' ..A few questions - Does it create Tags? Tag Library Descriptor files? Does it generate desciptor files (struts-config.xml?)? Does it generate entity beans? session beans? Does it war the file afterwards? Does it cold deploy /hot deploy to Tomcat ? If so which version? ??? M- - Original Message - From: [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Wednesday, August 10, 2005 12:07 PM Subject: Nice try (was Java code generator including Struts 1.2) Registrant: LeEonsoft 1300 Fern Hill Court Tallahassee, Florida 32312 United States Registered through: GoDaddy.com (http://www.godaddy.com) Domain Name: LEEONSOFT.COM Created on: 23-Dec-02 Expires on: 23-Dec-13 Last Updated on: 27-Jul-05 Administrative Contact: Xie, Jinpeng [EMAIL PROTECTED] LeEonsoft 1300 Fern Hill Court Tallahassee, Florida 32312 United States 8508948808 Technical Contact: Xie, Jinpeng [EMAIL PROTECTED] LeEonsoft 1300 Fern Hill Court Tallahassee, Florida 32312 United States 8508948808 Domain servers in listed order: NS1.NETTALLY.COM NS2.NETTALLY.COM Registry Status: ACTIVE Jinpeng Xie [EMAIL PROTECTED] 08/10/2005 11:54 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Java code generator including Struts 1.2 Dear struts users, I purchased Dreamsource- a Java code generator from Leeonsoft company ( http://www.leeonsoft.com) last week. It is so powerful code generator. It generates all source codes including Struts 1.2 codes. I highly recommend this product to you. I hope you can save a lot of development hours as I did. Best regards, Jinpeng __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nice try (was Java code generator including Struts 1.2)
VisualAge for Java, Remember it well. I went through the same senerio with it's EJB generator. Frank W. Zammetti [EMAIL PROTECTED] Frank W. Zammetti [EMAIL PROTECTED] 08/10/2005 01:34 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Struts Users Mailing List user@struts.apache.org Subject RE: Nice try (was Java code generator including Struts 1.2) Anyone who has read this list for a while knows my feeling on automated code generation... saying it's a crime against humanity might be overstating my opinion a bit, but not by much :) I think Greg says it well though... I never had a problem using the application wizard in Visual C++... it just created a very simple skeleton application, everything else was up to me. I have no problem with that. Plug-ins that generate simple beans I can live with. Utilities that let me enter a list of basic information on class members and spit out the skeletal class code for me are fine. Those tools that take in a WSDL file and spit out a very basic Web Service client from it are OK, barely... they haven't crossed that line I don't want crossed yet, but they are on the way... I remember having to deal with some Swing code that was created by a junior programmer using some IDE (I forget which frankly, it's not on the market any more - I want to say it was IBM's old one before WSAD, but I might be wrong). The code was such an immense tangle of crap it still makes me shudder to think of it all these years later. THAT is the kind of code generator that will NEVER be allowed in my shop, no matter how productive it might make lesser developers. I don't care how easy and fast it is to drag some pictrues on a canvas, draw some lines to show interactions, enter a little bit of additional info and get essentially a whole applicatio out... that kind of stuff won't go on where I have any say in the matter. The cost in the long-run so far outweighs the immediate benefits as to be laughable, or so has been my experience anyway. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, August 10, 2005 1:18 pm, Lindholm, Greg said: That's a very narrow view of code generators. There are plenty of domains where the generator is used once to give the programmer a starting point. (I'm not commenting on nor judging this guys stuff.) -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 10, 2005 1:05 PM To: 'Struts Users Mailing List' Subject: AW: Nice try (was Java code generator including Struts 1.2) Hmm... I think you clearly offence the rule one for generators: generated code should never be touched! Regards leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Nice try (was Java code generator including Struts 1.2)
WebSphere Application Developer has a Struts Diagraming tool that will let you create a skeleton struts application using drag and drop. It does very well. It will populate your struts-config.xml and create skeleton JSPs, ActionClasses, FormObjects, and the like. No actual code generation, just the shell. If you are looking for something a little more robust, the Rational rapid developer will do the same thing using UML and will Shell out you application based on your model. Again little actual code generation, but it will give lesser developers a good starting point using real design/archetecture. Frank W. Zammetti [EMAIL PROTECTED] Frank W. Zammetti [EMAIL PROTECTED] 08/10/2005 01:34 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Struts Users Mailing List user@struts.apache.org Subject RE: Nice try (was Java code generator including Struts 1.2) Anyone who has read this list for a while knows my feeling on automated code generation... saying it's a crime against humanity might be overstating my opinion a bit, but not by much :) I think Greg says it well though... I never had a problem using the application wizard in Visual C++... it just created a very simple skeleton application, everything else was up to me. I have no problem with that. Plug-ins that generate simple beans I can live with. Utilities that let me enter a list of basic information on class members and spit out the skeletal class code for me are fine. Those tools that take in a WSDL file and spit out a very basic Web Service client from it are OK, barely... they haven't crossed that line I don't want crossed yet, but they are on the way... I remember having to deal with some Swing code that was created by a junior programmer using some IDE (I forget which frankly, it's not on the market any more - I want to say it was IBM's old one before WSAD, but I might be wrong). The code was such an immense tangle of crap it still makes me shudder to think of it all these years later. THAT is the kind of code generator that will NEVER be allowed in my shop, no matter how productive it might make lesser developers. I don't care how easy and fast it is to drag some pictrues on a canvas, draw some lines to show interactions, enter a little bit of additional info and get essentially a whole applicatio out... that kind of stuff won't go on where I have any say in the matter. The cost in the long-run so far outweighs the immediate benefits as to be laughable, or so has been my experience anyway. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Wed, August 10, 2005 1:18 pm, Lindholm, Greg said: That's a very narrow view of code generators. There are plenty of domains where the generator is used once to give the programmer a starting point. (I'm not commenting on nor judging this guys stuff.) -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 10, 2005 1:05 PM To: 'Struts Users Mailing List' Subject: AW: Nice try (was Java code generator including Struts 1.2) Hmm... I think you clearly offence the rule one for generators: generated code should never be touched! Regards leon - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: What is the recomended framework
I think the true answer to that question is it depends. What is your tolerance for new technology? What is your expectation for integration with older systems? What is your developer experiance base? etc Personally, if I were starting a project from scratch with no chance of integration with applications of another framework, I would be fooking at JSF as the foundation of my project. This is because it is an accepted standard for the new JVMs. I would probably look at spring or shale to simplify some of the monkey work. The dangers on this implementation are: a) Finding a large support base for this technology as it is new and has less implementations than legacy architectures like struts. b) Finding competent developers if the project is large enough to have multiple developers for the same reasons as A. c) Requires 1.4 or higher java. I personally do not have a problem with this, but a large company (I know several) may still be running 1.3 for many of their legacy applications and are not willing to move to 1.4 or 1.5 d) JSF does not have the proven implementation for large scale, high traffic, high volume web applications yet. (At least I do not know of one). I am talking about the 10,000+ simultanious users with 100,000+ transaction per hour range. I think the technology can handle it, but it would require a lot of scalability testing on my part before I released a new application under these conditions. e) Not as much open source code bases to pull from. Could affect time to market. However, I do feel this is the way the web app market is moving, expecially in combination with Ajax for the user interface (Which JSF has some nice integration packages already). David Thielen [EMAIL PROTECTED] David Thielen [EMAIL PROTECTED] 08/05/2005 02:54 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject What is the recomended framework Hi; This whole struts/shale/jsf/spring/kitchen sink discussion has brought up a fundamental question. What should we use, assuming new code to keep it simple. So, what should we be using on the presentation and persistence side? JSF and Hibernate seem to be a yes from everyone. But what about shale, spring, tapestry, etc? And any comments on JSF and hibernate too? (I am assuming no EJBs as that is a very different environment on the persistence side and seems to be on the way out.) And of interest to me - what is the recomended approach for a portlet. And for most of the others on the list - what is best for a plain old J2EE system? Thanks - dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Validator w/ Modules
Hi everyone, I am having difficulty getting validator to work with my module based struts application. I have tried serval approches to no avail. My Struts Config and module config have: plug-in className=org.apache.struts.validator.ValidatorPlugIn set-property property=pathnames value=/WEB-INF/validator-rules.xml,,/WEB-INF/validation.xml,/WEB-INF/module/validation.xml/ /plug-in My /module/validation.xml has: form-validation formset form name=formName field property=fieldName depends=integer arg0 key=label.fieldName resource=com.module.resources.module/ /field /form /formset /form-validation If I use client side html:javascript formName=formName It does generate the script with all validations listed in the xml. so I think that the Plug-in is correct. I would use the client side script except it generates incorrectly. It creates methods like formName_IntegerValidations() but the actual validateInteger calls for just IntegerValidation() (No formName). If I use client side, it never calls the validations. I have also tried using: form name=/action and form name=/module/action with no difference. Any thoughts? People are conversing... without posting their email or filling up their mail box. roomity.com http://roomity.com/launch.jsp No sign up to read or search this Rich Internet App ~~1122993898600~~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: logic:iterate tag and form beans
Example: DataBean: public class EmployeeBean(){ private String name = null; Private String dept = null; ... Getters and setters } FormBean: public class EmployeeForm extends ActionForm{ private Collection employees = new ArrayList(); ... Getters and Setters } ActionClass: public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { EmployeeForm empForm = (EmployeeForm) form; //getEmployeesFromDatabase should return a collection of EmployeeBeans empForm.setEmployees(getEmployeesFromDatabase()); return mapping.findForward(display); } JSP: table trthName/th thDept/th html:form action=xyz method=post logic:iterate id=emp name=EmployeeForm property=employees trtdhtml:text property=name//td tdhtml:text property=dept//td /tr /logic:iterate /html:form People are conversing... without posting their email or filling up their mail box. roomity.com http://roomity.com/launch.jsp No sign up to read or search this Rich Internet App ~~1122996240050~~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Can u help me...I have a problem related to struts.
I would recommend changing the capital T to a lowercase t. This is standard. I have had problems in the past with having uppercase variable names. This is due to the reflection that Struts uses to find associated getters and setters. Johnson, Kaerstin [EMAIL PROTECTED] Johnson, Kaerstin [EMAIL PROTECTED] 08/02/2005 11:34 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org, Swapnil Patil [EMAIL PROTECTED] cc Subject RE: Can u help me...I have a problem related to struts. Sounds like you probably have a case problem. Please make sure that you reference Title with the capital T throughout the struts, jsp and bean. I can see your set method references title with lower case, this is probably the culprit. Hope this helps. -Original Message- From: Swapnil Patil [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 02, 2005 11:13 AM To: Johnson, Kaerstin Subject: Can u help me...I have a problem related to struts. Hi Johnson, I am vary sorry for mailling on your personal email address.I had posted my problem on the mailing list but till now don't get any reply. If you have time plz take a look. I am new in Struts framework. I had created simple Form containging 2 members variables as Form1 { String Title; Collection col; } I had created getter setter for both the members. Now in my jsp page I had coded like html:form action=""> ( DisplayGraphStep2 is linked with the above Form1.) Now if try like html:text property=col/ then it works but i try for html:text property=Title/ I get an exception ; Root Cause - javax.servlet.ServletException: No getter method for property Title of bean org.apache.struts.taglib.html.BEAN at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex tImpl.java:530) at org.apache.jsp.graphStep1_jsp._jspService(graphStep1_jsp.java:90) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137) setTitle(String title) and getTitle() methods are present in Form1 class mapping is like form-bean name=GraphStep1Form type=GraphStep1Form/ action path =/DisplayGraphStep2 type =DisplayGraphStep2 name = GraphStep1Form forward name =successpath =/graphStep2.jsp/ Thanks in Advance. Swapnil Patil - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Error Message Problem (Again)
Hi All, Seems this is a constant area of irritation. I am attempting to put an error message into the ActionMessage in an Action Class and redisplay this on a JSP page. This application is using tiles and is located in a Struts Module. Seems simple enough, but I can't get the darn thing to display on the JSP. Here is extracts from my code. Action Class: public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { ActionForward forward = mapping.findForward(fail); ActionMessages errors = new ActionMessages(); ... errors.add(displayerror, new ActionMessage(myerror, false)); ... saveErrors(request, errors); } JSP Page: html:form action=/myAction.do method=post html:messages id=error property=displayerror bean:write name=error / /html:messages ... /html:form I have also tried: html:form action=/myAction.do method=post html:errors/ ... /html:form Neither work I inspect errors on the save error line and can see the error message in the ActionMessage list, so I know it is being added to the request. I also used the false attribute to simply display myerror on the page to eliminate the possibilty of a properties file typo problem. Any recommendations on where to look?
RE: Error Message Problem (Again)
No luck. I also added test inside the logic:messagesPresent ... tag. The text was not displayed which indicates the save did not put any messages into the request, Yet, the ActionMessages does have a message in it and the saveMessage(request, errors) line is called. Harland, David [EMAIL PROTECTED] Harland, David [EMAIL PROTECTED] 07/28/2005 08:52 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject RE: Error Message Problem (Again) Hi, Try the following: Use saveMessages(request, messages) instead of saveErrors(request, errors) And use something like logic:messagesPresent message=true tr tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr html:messages id=message message=true tr tdnbsp;/td td colspan=8 class=style1font color=redlibean:write name=message//li/font/td tdnbsp;/td /tr tr tdnbsp;/td td colspan=8 class=style1nbsp;/td tdnbsp;/td /tr /html:messages /logic:messagesPresent In your web page. Regards David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 28 July 2005 13:35 To: user@struts.apache.org Subject: Error Message Problem (Again) Hi All, Seems this is a constant area of irritation. I am attempting to put an error message into the ActionMessage in an Action Class and redisplay this on a JSP page. This application is using tiles and is located in a Struts Module. Seems simple enough, but I can't get the darn thing to display on the JSP. Here is extracts from my code. Action Class: public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { ActionForward forward = mapping.findForward(fail); ActionMessages errors = new ActionMessages(); ... errors.add(displayerror, new ActionMessage(myerror, false)); ... saveErrors(request, errors); } JSP Page: html:form action="" method=post html:messages id=error property=displayerror bean:write name=error / /html:messages ... /html:form I have also tried: html:form action="" method=post html:errors/ ... /html:form Neither work I inspect errors on the save error line and can see the error message in the ActionMessage list, so I know it is being added to the request. I also used the false attribute to simply display myerror on the page to eliminate the possibilty of a properties file typo problem. Any recommendations on where to look? This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Error Message Problem (Again)
Sorry, it does work, I forgot to change the messages name from errors. Thank you for the help... Harland, David [EMAIL PROTECTED] Harland, David [EMAIL PROTECTED] 07/28/2005 08:52 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject RE: Error Message Problem (Again) Hi, Try the following: Use saveMessages(request, messages) instead of saveErrors(request, errors) And use something like logic:messagesPresent message=true tr tdnbsp;/td tdnbsp;/td tdnbsp;/td /tr html:messages id=message message=true tr tdnbsp;/td td colspan=8 class=style1font color=redlibean:write name=message//li/font/td tdnbsp;/td /tr tr tdnbsp;/td td colspan=8 class=style1nbsp;/td tdnbsp;/td /tr /html:messages /logic:messagesPresent In your web page. Regards David. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 28 July 2005 13:35 To: user@struts.apache.org Subject: Error Message Problem (Again) Hi All, Seems this is a constant area of irritation. I am attempting to put an error message into the ActionMessage in an Action Class and redisplay this on a JSP page. This application is using tiles and is located in a Struts Module. Seems simple enough, but I can't get the darn thing to display on the JSP. Here is extracts from my code. Action Class: public ActionForward execute(final ActionMapping mapping, final ActionForm form, final HttpServletRequest request, final HttpServletResponse response) { ActionForward forward = mapping.findForward(fail); ActionMessages errors = new ActionMessages(); ... errors.add(displayerror, new ActionMessage(myerror, false)); ... saveErrors(request, errors); } JSP Page: html:form action="" method=post html:messages id=error property=displayerror bean:write name=error / /html:messages ... /html:form I have also tried: html:form action="" method=post html:errors/ ... /html:form Neither work I inspect errors on the save error line and can see the error message in the ActionMessage list, so I know it is being added to the request. I also used the false attribute to simply display myerror on the page to eliminate the possibilty of a properties file typo problem. Any recommendations on where to look? This e mail is from DLA Piper Rudnick Gray Cary UK LLP. The contents of this email and any attachments are confidential to the intended recipient. They may not be disclosed to or used by or copied in any way by anyone other than the intended recipient. If this email is received in error, please contact DLA Piper Rudnick Gray Cary UK LLP on +44 (0) 8700 11 quoting the name of the sender and the email address to which it has been sent and then delete it. Please note that neither DLA Piper Rudnick Gray Cary UK LLP nor the sender accept any responsibility for viruses and it is your responsibility to scan or otherwise check this email and any attachments. DLA Piper Rudnick Gray Cary UK LLP is a limited liability partnership registered in England and Wales (registered number OC307847) which provides services from offices in England, Belgium, Germany and the People's Republic of China. A list of members is open for inspection at its registered office and principal place of business 3 Noble Street, London EC2V 7EE. Partner denotes member of a limited liability partnership. DLA Piper Rudnick Gray Cary UK LLP is regulated by the Law Society and is a member of DLA Piper Rudnick Gray Cary, a global legal services organisation, the members of which are separate and distinct legal entities. For further information, please refer to www.dlapiper.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
bean:write format
Has Anyone used the format attribute to format currency? I have a property in an ActionForm which will hold a dollar figure and want to format when displaying. ie. listPrice = 930 Need to Display $930.00 or listPrice = 1299.9 Needs to Display $1,299.90 I have attempted the following bean:write name=myForm property=listPrice format=\\$\\d+\\.\\d\\d/ but that prints \$\D+\930.\d\d not exactly what I was hoping for :)
Re: bean:write format
Never mind was using regular _expression_ formatting, Needed to use format=$###,000.00 [EMAIL PROTECTED] [EMAIL PROTECTED] 07/28/2005 03:58 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject bean:write format Has Anyone used the format attribute to format currency? I have a property in an ActionForm which will hold a dollar figure and want to format when displaying. ie. listPrice = 930 Need to Display $930.00 or listPrice = 1299.9 Needs to Display $1,299.90 I have attempted the following bean:write name=myForm property=listPrice format=\\$\\d+\\.\\d\\d/ but that prints \$\D+\930.\d\d not exactly what I was hoping for :)
RE: Re: JSF is the beginning of the end of Struts !!!
I guess I am a little lost on this comment. There are hundreds / thousands of complex Java sites available on the internet. Examples include US Airways Reservation system, EBay, BlueCross BlueShield of South Carolina, CitiBank, etc. All of these public sites support very large user bases. John Henry Xu [EMAIL PROTECTED] John Henry Xu [EMAIL PROTECTED] 07/26/2005 06:15 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject RE: Re: JSF is the beginning of the end of Struts !!! Mark, You are right. I worked on Java and hope Java success. That is the reason my links are java-based. I just want see more sites written in Java. That is why I think in Java world, we need more doers than talkers. If more java programmers code complex sites, java could compete to PHP. But now almost all public sites are dominated by PHP and others... Hope other Java programmers provides Java links as well. John H. Xu http://www.usanalyst.com http://www.Getusobs.com(The largest free job portal in North America) - Original Message - From: Mark Benussi To: 'Struts Users Mailing List' Subject: RE: Re: JSF is the beginning of the end of Struts !!! Date: Tue, 26 Jul 2005 22:35:53 +0100 It is interesting to see that the two sites on your footer are written using JSP. -Original Message- From: John Henry Xu [mailto:[EMAIL PROTECTED]] Sent: 26 July 2005 20:42 To: Struts Users Mailing List Subject: RE: Re: JSF is the beginning of the end of Struts !!! It is interesting to see PHP that has simple programming models defeat Java in real applications. This leads to a question: Do Java best programming models and frameworks conter-productive for real applications and sites? The new frameworks, other than struts, I like Spring. I would not use JSF unless JSF had some real applications (based on Sun's reputation on their new technologies). John H. Xu http://www.usanalyst.com http://www.GetusJobs.com(The largest free job portal in North America) - Original Message - From: Daniel Perry To: Struts Users Mailing List Subject: RE: Re: JSF is the beginning of the end of Struts !!! Date: Tue, 26 Jul 2005 09:45:53 +0100 PHP / (origional) JSP are the same stuff really. Scripted web page. Main difference is php not OO (well, the api isnt), and php doesnt require any declarations/typing - which makes it nicer for less able programmers. But the big difference is server requirements. JSP uses a lot more server resources. PHP can be made available on the cheapest mass virtual hosting servers. JSP (let alone full java web apps) cant. Also, pretty much anyone with any programming skills can pick up php in a couple of days. Same cant be said for e.g. Struts+Java+JSP+Servlet etc. This is why i am forced to use php for most sites (ok, so i normally pass it on to someone else here), and i tend to use struts for larger sites/apps that are going to be hosted internally/on dedicated servers. Daniel. -Original Message- From: John Henry Xu [mailto:[EMAIL PROTECTED]] Sent: 26 July 2005 04:17 To: Struts Users Mailing List Subject: Re: Re: JSF is the beginning of the end of Struts !!! JSF has been there for a while. We have to see how it does in real applications. EJB has been there for many years, but its complexity of configuration (at least before mature tools were developed) kept many J2EE projects expensive and over budgets (bad ROI examples). Thus we have so many frameworks in Java. Sun is to be blamed for always providing UNPROVEN technologies for java. In many cases, following sun too closely is not wise. PHP was great but I hope java can catch up in real application. John H. Xu http://www.usanalyst.com http://www.GetusJobs.com(The largest free job portal in North America) - Original Message - From: netsql To: user@struts.apache.org Subject: Re: JSF is the beginning of the end of Struts !!! Date: Mon, 25 Jul 2005 20:13:05 -0500 John Public wrote: After just finishing my JSF class, I can confidently confirm that JSF will eventually lead to Struts becoming OBSOLETE. :-) Enhydra and Torque would say that too circa 2001. Put up a site and lets see it. Let's all get behind JSF before MS takes over the web. Nothing wrong w/ C# IMO. I think PHP is best(fast and cheap, lowest risk, most roi) for genric server side rendering applications. (But then... I think the future is client side rendering ) If JSF(or EJB) fails, it won't be becuase somone did not get behind it. Competition should give us best answer, and I am all for
Re: [Tiles] Sharing Context Between Two Tiles
Portlets are java mini applications that work within the Java Portlet Specification. They are ment to run using a Portal Server like Websphere Portal server, Metadot, or jetspeed. These 'applications' can share variables, etc via the Portlet container. The container manages the placement and look and feel of the applications in a simular fashen to the tiles layout, but come with a overhead cost. (I would venture to say much larger than the tiles overhead). Adam Hardy [EMAIL PROTECTED] Adam Hardy [EMAIL PROTECTED] 07/27/2005 05:38 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [Tiles] Sharing Context Between Two Tiles Basically that is the way you do it, although I'm not really sure from your description that I know why you thought you could achieve what it looks like you were attempting. A question for you that bugs me everytime I see 'portlet' come up: what on earth are portlets? Are they meant to be a different technology to 'servlets'? Surely not, as you are using JSPs. Adam Ian Brandt on 26/07/05 18:17, wrote: Hello All, I'm trying to write a portlet like component using tiles. A simplified version of my first attempt follows: The portlet definition: definition name=.uicomponents.portlet path=/tiles/uicomponents/portlet.jsp put name=content/ /definition portlet.jsp: [...] div class=portletStyle tiles:insert attribute=content/ /div The definition for a particular portlet: definition name=.portlets.oneportlet extends=.uicomponents.portlet !-- For this definition we're going to use this JSP as the portlet content... -- put name=content value=/portlets/oneportlet.jsp/ !-- We're also going to define a parameter that is required by oneportlet.jsp -- put name=aParam/ /definition oneportlet.jsp: [...] tiles:useAttribute id=aParam name=aParam classname=com.mycompany.SomeClass/ c:out value=${aParam.someProperty}/ Finally a body page that inserts oneportlets: [...] c:forEach var=someClass items=${requestScope.collectionOfSomeClasses} tiles:insert definition=.portlets.oneportlet tiles:put name=aParam beanName=someClass/ /tiles:insert /c:forEach Upon trying this I found that aParam is not available to oneportlet.jsp (attribute not found error on tiles:useAttribute). I did find that aParam was available to portlet.jsp. From this I realized that my tiles:insert in portlet.jsp was creating a new tile context for oneportlet.jsp, and the fact that my .portlets.oneportlet definition was extending .uicomponents.portlet did not mean that their context would be shared. The only solution I've been able to think of so far is to add a generic attributes attribute to my base portlet definition, and just pass that on the insert of the content defined by the extending definition: The new portlet definition: definition name=.uicomponents.portlet path=/tiles/uicomponents/portlet.jsp put name=content/ put name=attributes/ /definition The new portlet.jsp: [...] div class=portletStyle tiles:importAttribute name=attributes/ tiles:insert attribute=expandedContent tiles:put name=attributes beanName=attributes/ /tiles:insert /div My body page has to build up a collection of all the parameters that oneportlet needs (either from the action or using scriptlets), and oneportlet has to iterate through that collection pulling out the parameters it needs. It's hard read and maintain. So thanks for listening to this point, and now for my question: can anyone think of a better approach? My next attempts were going to be seeing if a tiles controller for .uicomponents.portlet could copy it's context to the inserted content, or trying a JSTL import instead of a tiles insert and seeing if the portlet's tiles context would be available to the imported page. Is there an entirely different way to look at this that I'm not thinking of? Thanks! Ian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts + JavaScript = dynamic forms
There are several ways that this can be accomplished. 1. Pure Struts. You can create an Initialization Action which holds you form as the input form. When you change select 1, in the onchange submit the page to the init.do. the page will retain all input values as the form will maintain your entries. The problem is that the page will noticably flicker. 2. Pure _javascript_. Down load all options and used _javascript_ to change out the values. Downside, you have a larger page to download (_javascript_) and you have to download all possible options, many of which you will not need. 3. AJAX. The new kid on the block. The Onchange will run a java mthod which will connect to the server and return the updated options. Check out DWR or equivalent. I am sure there is a JSF or PHP solution as well but I am not familar enough with those technologies to comment. All three of these options will use _javascript_ to some extent and if someone has _javascript_ disabled, this will not work. Janek Ziniewicz [EMAIL PROTECTED] Janek Ziniewicz [EMAIL PROTECTED] 07/26/2005 05:38 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Struts + _javascript_ = dynamic forms I d like to write a form with, say, 3 dropboxes. Choosing an option in 1. box changes list of available options in other 2 boxes. [Eg. box #1 can store list of countries and box #2 list of cities in chosen country, or all cities if no country is chosen.] It can be done with _javascript_. However, I am looking for your opinion about Struts-way of doing that task. -- Pozdrawiam, Janek Ziniewicz gg: 902858 irc.freenode.net: #gore, #dub - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF is the beginning of the end of Struts !!!
I am the same way. I have a large collection of common libraries that I have developed over the past 5 years or so. Each iteration, they get a little more powerful. I can create a highly scalable and complex application very quickly using Struts because of this. Yes java may be overkill for a personal home page, but for mission critical applications or sites that require 1000's of transactions per hour, it is a must. I hope JSF takes off and becomes as easy to use as VS 2005, but until a wide range of either customer components or vendor developed components are available, its reach will be limited by comparision. I think it will happen, but not over night. Until then, there are very few languages that can deliver the power and speed of development as my struts / Java library. Mark Benussi [EMAIL PROTECTED] Mark Benussi [EMAIL PROTECTED] 07/26/2005 07:45 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Re: JSF is the beginning of the end of Struts !!! Luckily my apps are written with a large amount of the code written for each customer, with reusable taglibs plugging into each site. All my DAO etc is done as the sites use the same DB schema and therefore code. I am 90% of the way there from day 0 with each customer so this is not an issue. I dont think i am falling for any marketing theory, I have bene doing Java apps for about 7 years. I didnt even see your point anyway. Is it marketing hype to state that Struts/Java/Servlets is for large applications and I would not build a suite of actions and database pooling for my old mans plane photos web site Original Message Follows From: netsql [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: Re: JSF is the beginning of the end of Struts !!! Date: Tue, 26 Jul 2005 06:27:35 -0500 Mark Benussi wrote: I have never done any PHP so I can't comment, but agree with the previous comments in so far as Struts/Java/Servlets is for large applications. I would not build a suite of actions and database pooling for my old mans plane photos web site. You may be just repeating the marketing theory, not what was validated in practice. Friendster switched to PHP after Java, so I guess they did not find Java scaleable. On a large project you may want to reduce risk by starting w/ 80% of project done and customize the last 20%. Imagine, 1st week and you are 80% done. There is DAO, etc for PHP, take a look at architecture of TikiWiki. And my faviorte lesson: Home page of Spring is in Plone. Here is a good summary of what's out there: http://www.opensourcecms.com/index.php?option=contenttask=viewid=388Itemid=143 So if you do non RiA application you need to objactivley consider php and plone, see if they have a solution w/ less risk. .V - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Actions forwarding to actions
Not always. An Action should be created to perform a specific control instance. For Example, if you are going to insert a record, the Action class has all the required code to insert the record. However, as you get into more complex systems, you will often find that you are duplicating a lot of the same functions. At this point you have to abstract many of these functions into utility or helper classes to reduce the amount of duplication that you have. This reduces your action class down to simply flow control logic. But if this becomes highly repetitive, then you may breakout into calling multiple actions that know how to handle a specific set of events. Lance Semmens [EMAIL PROTECTED] Lance Semmens [EMAIL PROTECTED] 07/26/2005 12:24 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Actions forwarding to actions I'm a newbie to struts and I'm maintaining what I consider to be spaghetti code. There actions which forward to other actions and I'm getting lost a bit lost at times. As a rule, should an action be all encompassing and therefore not need to forward to another action? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Technique for undetermined time of processing - progress bar
Unfortunately, any AJAX implementation will require _javascript_. You can replace this with a standard JSP implementation, but you will have a lot of Flicker as your page updates. You will also have to keep all information that is displayed on your page in the session or request which can chew up your bandwidth on heavly used sites. David Erickson [EMAIL PROTECTED] David Erickson [EMAIL PROTECTED] 07/23/2005 09:52 AM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject RE: Technique for undetermined time of processing - progress bar What If the end user has _javascript_ disabled? Does DWR handle that cleanly or are you out of luck? -David _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, July 22, 2005 1:55 PM To: Struts Users Mailing List Cc: 'Struts Users Mailing List' Subject: Re: Technique for undetermined time of processing - progress bar I use AJAX to kick off the process. For this case You can send an AJAX request to get the time, once recieved display a div that will contain the progress bar and submit a second request to run the actual process. On completion, you can forward the page to the next url. If you use DWR and can just display an anamated gif or flash movie, then you can use the built in pre and post process hooks. The preprocess would display the image and the post would hide it. on completion of the process have the page submit to the next screen. Inactive hide details for David Erickson [EMAIL PROTECTED]David Erickson [EMAIL PROTECTED] David Erickson [EMAIL PROTECTED] 07/22/2005 02:41 PM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject Technique for undetermined time of processing - progress bar Sorry for the vague subject. I've got a situation where I need to do some processing before moving a user to a specific page. The processing could be very fast or very long. I'd like to have some kind of a progress bar type meter than can show how much time is left. I will know for sure the exact time it will take to process, and I can retrieve that at the beginning of the processing. When processing is done I want to go to a different url. Has anyone done anything like this before, and if so what were the best ways you found of accomplishing this? Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: AW: [OT] Struts and Content Management
Thank you all for your input, we are evaluating several of the CMS apps that have been recommended. As always, I applaude the rapid feedback and knowledge that is available on this mailing list. thank you again. Leon Rosenberg [EMAIL PROTECTED] Leon Rosenberg [EMAIL PROTECTED] 07/21/2005 05:01 PM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject AW: AW: [OT] Struts and Content Management then take a look at coremedia :-) We've payed about 250.000 for it once, but it was worth the money :-) leon _ Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 21. Juli 2005 22:56 An: Struts Users Mailing List Cc: 'Struts Users Mailing List' Betreff: Re: AW: [OT] Struts and Content Management As always free is better :) but not a requirement Inactive hide details for Leon Rosenberg [EMAIL PROTECTED]Leon Rosenberg [EMAIL PROTECTED] Leon Rosenberg [EMAIL PROTECTED] 07/21/2005 04:20 PM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject AW: [OT] Struts and Content Management You need a free cms system? If not have a look at coremedia (www.coremedia.com) It's the (imho) best cms available, very well architectured, fast, uses corba, Supports multiple databases... works perfectly with struts. :-) Regards Leon -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 21. Juli 2005 15:43 An: user@struts.apache.org Betreff: [OT] Struts and Content Management Sorry for the off topic, I am starting a new project that will be struts based and will require a content management system. I have looked at OpenCMS but was wondering what others have used. Basic requirements Java 1.5 Tomcat 5.5 Struts 1.2.7 / with tiles Any Suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question
I think you are re-inventing something here. To do what you are wanting is already in struts to some degree. you have your User Bean, You define an formbean which either contains UserBean or contains fields that match UserBean on your jsp page you create something like html:html local=true html:form action="" method=post bean:message key=resource.key/html:text propery=userId/ /html:form /html:html This will print the UserID's label from the Resource file and give you internationalization. This might be easier than embedding HTML into a tag or bean. Daniel Łaś [EMAIL PROTECTED] Daniel Łaś [EMAIL PROTECTED] 07/22/2005 09:03 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Design question Hi I'm interested in yours opinions about following design approach. I'd like to create some kind of view beans for viewable model beans. Those view beans can generate HTML for attached model bean. This generated HTML is based on resources, so I am able to generate different HTML code depending on session locale. Lets say I create one model bean User I created UserView with reference pointing to User. I attached reference to MessageResources in UserView bean during action execution with getResources(request) In my JSP I added: bean:write name=UserView property=content filter=false/ which calls getContent() method UserView method body is: public String getContent() { return messages.getMessage(user.login)+user.getLogin(); } where: messages - private UserView member of class MessageResources user - private UserView member of class User user.login - resources key Everything worked well, but when I changed session locale my UserView bean generates output for previus locale. I think that I have to update messages member of UserView bean or use reference to other object, maybe servlet which will be constant during session. I'm new to struts, so I'd like to know if there are some other issues connected to mentioned design and struts? Regards -- Daniel Łaś [EMAIL PROTECTED] e-direct Polska sp. z o.o. ul. 1-go Maja 9 45-068 Opole tel. +48 77 44 17 868 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Design question
There are several possibilities to do what you are asking. You will still have to modify HTML code, it is just where. I would not typically create multiple jsp pages for Add, Update, Display. I would create a single page using a DynaValidatorForm. this way you can use the same form and based on the action you call, the appropriate validation will be performed. Additionally, I would look into the CRUD Action Examples to prevent me from developing multiple actions. Based on the funtion you are calling the appropriate Data Access function can be called. If this is set up properly you can get away with changing only two components for this to work the Business Object Bean and the HTML page. Granted, if you have this information on multiple pages like a login page, then as a display in the corner of each page within the application, you would need to update that on each JSP page. But it is likely you would want to do that anyway to insure the look and feel of each page. Daniel Łaś [EMAIL PROTECTED] Daniel Łaś [EMAIL PROTECTED] 07/22/2005 10:07 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Design question Well, I thing about something else. If UserView bean can generate HTML form fields dependig on User attributes, one for adding, another one for editing I could only change my User bean (model) and my view layer will work without change. I think that it is possible to write action that will work with this (controller layer) without change too. Lets say, I add new attribute to User, eg. lastName. I have to: 1. modify User bean code (model) 2. then modify appropriate jsp pages, first with edit form, second with add form 3. then modify struts-config.xml (form properties) 4. then modify appropriate form bean 5. then modify two actions (one for edit, one for add operation) It would be nice, to change only my model and have view layer adapting to model. Mabe I'm re-inventing the wheel. If so, please tell me. I'm new to struts and Java technologies, just trying to make right decisions before my projects start. Regards [EMAIL PROTECTED] napisał(a): I think you are re-inventing something here. To do what you are wanting is already in struts to some degree. you have your User Bean, You define an formbean which either contains UserBean or contains fields that match UserBean on your jsp page you create something like html:html local=true html:form action="" method=post bean:message key=resource.key/html:text propery=userId/ /html:form /html:html This will print the UserID's label from the Resource file and give you internationalization. This might be easier than embedding HTML into a tag or bean. Inactive hide details for Daniel Łaś [EMAIL PROTECTED]Daniel Łaś [EMAIL PROTECTED] *Daniel Łaś [EMAIL PROTECTED]* 07/22/2005 09:03 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Design question Hi I'm interested in yours opinions about following design approach. I'd like to create some kind of view beans for viewable model beans. Those view beans can generate HTML for attached model bean. This generated HTML is based on resources, so I am able to generate different HTML code depending on session locale. Lets say I create one model bean User I created UserView with reference pointing to User. I attached reference to MessageResources in UserView bean during action execution with getResources(request) In my JSP I added: bean:write name=UserView property=content filter=false/ which calls getContent() method UserView method body is: public String getContent() { return messages.getMessage(user.login)+user.getLogin(); } where: messages - private UserView member of class MessageResources user - private UserView member of class User user.login - resources key Everything worked well, but when I changed session locale my UserView bean generates output for previus locale. I think that I have to update messages member of UserView bean or use reference to other object, maybe servlet which will be constant during session. I'm new to struts, so I'd like to know if there are some other issues connected to mentioned design and struts? Regards -- Daniel Łaś [EMAIL PROTECTED] e-direct Polska sp. z o.o. ul. 1-go Maja 9 45-068 Opole tel. +48 77 44 17 868 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Daniel Łaś [EMAIL PROTECTED] e-direct Polska sp. z o.o. ul. 1-go Maja 9 45-068 Opole tel. +48 77 44 17 868 - To unsubscribe, e-mail: [EMAIL
Re: Technique for undetermined time of processing - progress bar
I use AJAX to kick off the process. For this case You can send an AJAX request to get the time, once recieved display a div that will contain the progress bar and submit a second request to run the actual process. On completion, you can forward the page to the next url. If you use DWR and can just display an anamated gif or flash movie, then you can use the built in pre and post process hooks. The preprocess would display the image and the post would hide it. on completion of the process have the page submit to the next screen. David Erickson [EMAIL PROTECTED] David Erickson [EMAIL PROTECTED] 07/22/2005 02:41 PM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject Technique for undetermined time of processing - progress bar Sorry for the vague subject. I've got a situation where I need to do some processing before moving a user to a specific page. The processing could be very fast or very long. I'd like to have some kind of a progress bar type meter than can show how much time is left. I will know for sure the exact time it will take to process, and I can retrieve that at the beginning of the processing. When processing is done I want to go to a different url. Has anyone done anything like this before, and if so what were the best ways you found of accomplishing this? Thanks, David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Struts and Content Management
Sorry for the off topic, I am starting a new project that will be struts based and will require a content management system. I have looked at OpenCMS but was wondering what others have used. Basic requirements Java 1.5 Tomcat 5.5 Struts 1.2.7 / with tiles Any Suggestions?
Re: [OT] Struts and Content Management
For the applications that we are running, we do require cross platform compatability. I will check out both of these. Thanks for the information. Daniel Henrique Ferreira e Silva [EMAIL PROTECTED] Daniel Henrique Ferreira e Silva [EMAIL PROTECTED] 07/21/2005 04:30 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [OT] Struts and Content Management Hi BHansard, Do you really have to stick to Java for a CMS? If, and only if, java is not mandatory for your project, i'd go for Zope + Plone. Together they are, imho, the best option for a CMS system available nowadays. Sure, as anything in this world, they aren't perfect, but you can have a great increase on development speed with them and have great ease of management in 99% of cases. But, if java IS mandatory, i'd go for InfoGlue instead of OpenCMS. I haven't production experience with InfoGlue, but the last time i looked for java CMS systems, it seemed to be the most mature and flexible one. Hope that helped. Cheers, Daniel Silva. On 7/21/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Sorry for the off topic, I am starting a new project that will be struts based and will require a content management system. I have looked at OpenCMS but was wondering what others have used. Basic requirements Java 1.5 Tomcat 5.5 Struts 1.2.7 / with tiles Any Suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: [OT] Struts and Content Management
As always free is better :) but not a requirement Leon Rosenberg [EMAIL PROTECTED] Leon Rosenberg [EMAIL PROTECTED] 07/21/2005 04:20 PM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject AW: [OT] Struts and Content Management You need a free cms system? If not have a look at coremedia (www.coremedia.com) It's the (imho) best cms available, very well architectured, fast, uses corba, Supports multiple databases... works perfectly with struts. :-) Regards Leon -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Gesendet: Donnerstag, 21. Juli 2005 15:43 An: user@struts.apache.org Betreff: [OT] Struts and Content Management Sorry for the off topic, I am starting a new project that will be struts based and will require a content management system. I have looked at OpenCMS but was wondering what others have used. Basic requirements Java 1.5 Tomcat 5.5 Struts 1.2.7 / with tiles Any Suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: TilesRequestProcessor is executed twice
I am currently working on my first tiles / struts module program myself. One thing that I had to do was to add the module aware option to the plug-in in struts-config.xml. plug-in className=org.apache.struts.tiles.TilesPlugin set-property property=definitions-config value=/WEB-INF/tiles-defs.xml,/WEB-INF/module1/tiles-defs.xml / set-property property=moduleAware value=true/ /plug-in I have not had a problem with the request processor running twice. Not sure if this has anything to do with it or not, but it is worth a try :) Ronnie Arosa [EMAIL PROTECTED] Ronnie Arosa [EMAIL PROTECTED] 07/20/2005 06:18 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject TilesRequestProcessor is executed twice Hello everybody, I'm working in a struts application with tiles and modules. It’s my first time working with tiles and I felt into a problem: the TilesRequestProcessor is called twice. This happens when I forward my actions to a tile. If the same action is forward to a simple page (i.e. a jsp page) everything goes normally. Here is one of my actions’ definition: action path=/myRequest type=com.indicusoft.struts.myRequestAction forward name=failure path=myRequest.page/forward forward name=success path=myRequest.page/forward /action And this is my tiles’ definition file: definition name=.mainLayout path=/common/classicLayout.jsp put name=title value=My application/put put name=header value=/common/header.jsp/put put name=menu value=/commons/blank.jsp/put put name=footer value=/common/footer.jsp/put put name=error value=/common/error.jsp/put put name=body value=/put /definition definition name=myRequest.page extends=.mainLayout put name=title value=Request Page/put put name=body value=/myRequest.jsp/put /definition Thanks in advance. Ronnie. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: instantiation of actionforms in session scope
In the case you outlined, wizardForm should be placed into the session scope when leaving the Funds action. You are not required to use the struts tags to access the data, but if you are using the struts html tags for input etc, you will need to use the html:form tag. If you are not using the struts tags, you should still be able to use the form bean with a standard jsp:usebean id=wizardForm scope=session You should also be able to access it from other action classes by explicitly calling the getAttribute(wizardForm). When you say that it is instantiated with every new page, how are you attempting to access the bean? Martin Morawetz [EMAIL PROTECTED] Martin Morawetz [EMAIL PROTECTED] 07/19/2005 07:12 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: instantiation of actionforms in session scope Thanks a lot for your answer. There could be several poteintal problems. 1) make sure the JSP does not have the session=false page directive set. It doesn't. 2) Make sure you are referencing the form using the same name as you have it defined in the struts config (remember capitalization does count). I've checked that and than again, the right bean gets filled with the right parameters from the request, so I think the problem isn't the configuration. The problem arises on the following pages, where I need the data to, but the bean gets instantiated with every new page again. The following lines are from my struts-config.xml: form-bean name=wizardForm type=com.cp.pub.WizardForm/ : : action-mappings action path=/Funds type=com.cp.pub.DefineContentFundsAction name=wizardForm scope=session /action : : 3) Make sure you are accessing the form from within the html:form tag and that the struts action specified in the form action has the expected form as the type in the struts config. I don't use html:form-tags. Could that be a problem? Hi to all, I use a formbean within session-scope (declared in struts-config.xml). However it behaves like it would be within request-scope. Every new page it gets instantiated again. I checked the sessionid and it is every page the same, so I guess am within the same http-session. Does anyone have some ideas what the reason may be? Every hint is highly appreciated. -- Regards Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
re: Problem in Struts Tags
the problem is that row is a generic object until you cast it i think. I have used this in then past by using syntax like html:radio ... value=%=(String)((java.util.HashMap)row).get(VALUE)% Looks ugly but it works. Note: I have not used it with a HashMap, but have with custom objects like ((com.app.Customer) cust).getName() so i am guessing you would have to cast the get to a string as it will return a generic object as well. Paul Moody [EMAIL PROTECTED] Paul Moody [EMAIL PROTECTED] 07/19/2005 07:53 AM Please respond to Struts Users Mailing List user@struts.apache.org To 'Struts Users Mailing List' user@struts.apache.org cc Subject re: Problem in Struts Tags I did a quick test and it seems that having the html:radio ... value=%=row.get(VALUE)% fails for me too. The output html contains html:radio ... instead of input type=radio Doing the following worked: % String val = (String) row.get(VALUE); % html:radio value=%=val% / Anyway, in general I don't like seeing scriptlets in jsps. I think your first method looked better to me with a Collection of beans containing properties. I think you can then use the following: html:radio property=xxx idName=row value=value / which will look in the bean exposed by the iterate tag and use its value property. Good luck. Paul Moody --- raghavendra [EMAIL PROTECTED] wrote: Hi paulsmoody This just a sample program I know UI labels are not good, Hard coded in Action class. Main problem is value=%=row.get(VALUE)% line not complied in JSP page why? logic:iterate id=row name=data type=java.util.HashMap html:radio property=expectedVia value=%=row.get(VALUE)%/ /logic:iterate -Original Message- From: Paul Moody [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 19, 2005 3:38 PM To: Struts Users Mailing List Subject: RE: Problem in Struts Tags I would expect you to have a problem with the jsp. You have an ArrayList with each element being a Map. When you iterate over the ArrayList with the logic:iterate tag each element, identified by row, is a Map. This means that the bean:write name=row property=label/ will fail because there is no getLabel method for the Map. You could try a %=row.get(LABEL)% to get the stored label from the Map which should work. However, I am not sure this is the best solution as you are coding your UI labels in your Action which is not best practice as far as I know. Hope this was of help. Paul Moody --- raghavendra [EMAIL PROTECTED] wrote: Please first under stand the problem, the problem in jsp page. Why the jsp page does't complile. Try the following code in u r system. logic:iterate id=row name=data type=java.util.HashMap html:radio property=expectedValue value=%=row.get(VALUE)%/ bean:write name=row property=label/ /logic:iterate OR logic:iterate id=row name=data type=java.util.HashMap % String value=(String)row.get(VALUE); % html:radio property=expectedValue value=%=row.get(value)%/ bean:write name=row property=label/ /logic:iterate OR logic:iterate id=row name=data scope=request input type=radio name=expectedVia value=bean:write name=row property=VALUE// bean:write name=row property=LABLE/ /logic:iterate -Original Message- From: Marsh-Bourdon, Christopher [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 19, 2005 3:21 PM To: 'Struts Users Mailing List'; [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: RE: Problem in Struts Tags You are adding the HashMap as an item to the ArrayList, not replacing the contents of the ArrayList with the contents of the HashMap. Try this: List shippers = new ArrayList(map); Instead of: shippers.add(map); And get rid of: ArrayList shippers = new ArrayList(); Cheers Christopher Marsh-Bourdon www.marsh-bourdon.com -Original Message- From: raghavendra [mailto:[EMAIL PROTECTED]] Sent: 19 July 2005 10:55 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; user@struts.apache.org Subject: Problem in Struts Tags Hi All See the following code In action class I had written like ArrayList shippers = new ArrayList(); shippers.add(new LabelValueBean(UPS, UPS)); shippers.add(new LabelValueBean(Federal Express, FEDX)); shippers.add(new LabelValueBean(AirBorne, AIRB)); request.setAttribute (SHIPPERS,shippers); And Jsp page written like logic:iterate id=row name=SHIPPERS type=org.apache.commons.scaffold.util.LabelValueBean html:radio property=expectedValue value=%=row.getValue()%/ bean:write name=row property=label/ /logic:iterate the above code working fine if u select any value and click submit and returns the same page back the selected radio button value is there . So long as one of the values matches the expectedVia property on our ActionForm, the radio tag will
Re: instantiation of actionforms in session scope
There could be several poteintal problems. 1) make sure the JSP does not have the session=false page directive set. 2) Make sure you are referencing the form using the same name as you have it defined in the struts config (remember capitalization does count). 3) Make sure you are accessing the form from within the html:form tag and that the struts action specified in the form action has the expected form as the type in the struts config. Martin Morawetz [EMAIL PROTECTED] Martin Morawetz [EMAIL PROTECTED] 07/18/2005 12:57 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject instantiation of actionforms in session scope Hi to all, I use a formbean within session-scope (declared in struts-config.xml). However it behaves like it would be within request-scope. Every new page it gets instantiated again. I checked the sessionid and it is every page the same, so I guess am within the same http-session. Does anyone have some ideas what the reason may be? Every hint is highly appreciated. -- Regards Martin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Alternate color in html:iterate
This is how I have handled it in the past. c:choose c:when test=${cssKey == 'odd'} bean:define id=cssKey value=even/ /c:when c:otherwise bean:define id=cssKey value=odd/ /c:otherwise /c:choose trtd class=c:out value=${cssKey}/xyz/td Senthilrajan VS [EMAIL PROTECTED] Senthilrajan VS [EMAIL PROTECTED] 07/13/2005 10:53 AM Please respond to Struts Users Mailing List user@struts.apache.org To Sturts Mailing list user@struts.apache.org cc Subject Alternate color in html:iterate Hi All, I'm using html:iterate to display the set of records in the table. Is there any way to put the alternate color using CSS classes in tag libraries Thanks Regards, SenthilRajan VS
Re: validation client-side. Problem with 2 submit buttons
If you are using Validator, you can create a DynaForm. then based on the action that you are calling, the validations can be different. This will work for either client side or server side supposedly. I have only used server side with it. Marc Demlenne [EMAIL PROTECTED] Marc Demlenne [EMAIL PROTECTED] 07/13/2005 10:56 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject validation client-side. Problem with 2 submit buttons Hello, Using struts validation framework, what's the best way to handle the following case : You have a simple form with 2 submit buttons. One for display, the other to modify changes. How to make the validation active only for modify button ? Server-side, you can simply have 2 actions name, one of them defined as validate=true, the other as validate=false. Is there a client-side equivalent ? Thanks a lot for any help. -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: validation client-side. Problem with 2 submit buttons
Instead of calling the return validateForm(this) function in the on submit, you could wrapper the check based on a _javascript_ variable. _javascript_ var validate = true /_javascript_ html:form action="" return validateForm(this); } html:submit = true;validate/html:submit html:submit = false;don't validate/html:submit /html:form Marc Demlenne [EMAIL PROTECTED] Marc Demlenne [EMAIL PROTECTED] 07/13/2005 11:30 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org, Rafael Taboada [EMAIL PROTECTED] cc Subject Re: validation client-side. Problem with 2 submit buttons I DO use struts validator framework ... What i want is to to have _only_ one of the submit button to check the client-side validation But I can only decide to call validator or not by form, not by button. As it is for client side that I have this problem, I can't call it from my modify method... On 13/07/05, Rafael Taboada [EMAIL PROTECTED] wrote: Hi, use Validator framework. In this framework u can put code in order to set a client-side validation for each feld. In ur modify method, call to ur validate method. I hope it can help u -- Rafael Taboada Software Engineer Cell : +511-97753290 No creo en el destino pues no me gusta tener la idea de controlar mi vida -- Marc Demlenne - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: html:select Problem !!
you have the html:options set correctly in the first example html:select property=selectedItem html:options collection=customers property=id labelProperty=name / /html:select in the second example you changed to: html:select property=tumSikayetler html:options collection=sikayetler value=sikayetKodu label=sikayet / /html:select try: html:select property=tumSikayetler html:options collection=sikayetler property=sikayetKodu labelProperty=sikayet / /html:select EROL TEZCAN [EMAIL PROTECTED] EROL TEZCAN [EMAIL PROTECTED] 07/12/2005 09:38 AM Please respond to Struts Users Mailing List user@struts.apache.org To sturts_apache_user sturts_apache_user user@struts.apache.org cc Subject html:select Problem !! Hi all, I want to set records come from database into a html:select tag. I found some example like below html:select property=selectedItem html:options collection=customers property=id labelProperty=name / /html:select When I set th options as static , the list comes without any problem. But when I create a html:select dynamicly from DB , I get error. In my Action class, it has a method called getSikayetler() like this. Sikayet sikayet = null; ArrayList sikayetler = new ArrayList(); while (rs.next()) { sikayet = new Sikayet(); sikayet.setSikayetKodu(rs.getString(SIKAYET_KODU)); sikayet.setSikayet(rs.getString(ACIKLAMA)); sikayetler.add(sikayet); } When I created an ArrayList, I send it to my Action class and in my Action class I set this ArrayList to request like below ArrayList listeDondur = getSikayetler(); request.setAttribute(sikayetler, listeDondur); sikayetler ArrayList is not null and empty, I tested it. How must I use this request object called sikayetler in html:select ? html:select property=tumSikayetler html:options collection=sikayetler value=sikayetKodu label=sikayet / /html:select usage of above is wrong? In Sikayet class there are get and set methods like sikayetKodu and sikayet . How can I fill html:select tag with records coming from DB? Any help, sample codes? Thanks Erol - Sell on Yahoo! Auctions - No fees. Bid on great items.
Re: Paging in DisplayTag
This is dependent on how you have structured you database query. There are multiple solutions to what you are attempting to do. 1. Create a query that will return the entire resultset and store that resultset in the session as you metion. If you are returning an extremely large result set, running the application in a clustered environment with percistant sessions to a database, or have a large number of users, this could prove problematic. The more you put into the session, the more memory your application will use. Additionally, if you persist your session, you are requerying each time you mention a session. This could be a mojor performance hit. Finnally, you are moving a lot of data across the network. If 90% of the users will find what they need on the first 1 or 2 pages of a resultset, pulling back the data to populate the reset of the menus is a waste of resources. 2. If all users are going to use the same resultset (ie multipage menuing or a product catalog), this may be a occation for a singleton class with a collection containing the data. You could refresh this singleton based on a timeframe to insure it remains current. this will only work for semistatic results. 3. Implement a fast lane reader pattern. This will subdivide your SQL results to return only the page that is being displayed using boundry conditions in the SQL or Stored procedure. This will require a database hit between each page, but if the database is properly indexed and you are using a connection pool, you can still retain very fast performance. I am sure there are many more ways to address this problem, but these are the three that I have had the most experiance with. It boils down to ever situation is different and you have to customize your solution based on the data, the business requirement, and the user habits. Phani [EMAIL PROTECTED] Phani [EMAIL PROTECTED] 07/07/2005 06:19 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org, Michael Jouravlev [EMAIL PROTECTED] cc Subject Paging in DisplayTag Hi, Shud my Action form be in session scope if I want to specify pagesize in display tag for paging.. Because I get the following error: Error 500: Cannot find bean storeForm in any scope Thanks, Phani. __ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing data between action forms
Typically, I will create a SearchBean with all of the search parameters on it. Included in this bean is a collection to store the results in. On the ActionForm, I will include the SearchBean as a parameter on the search bean. On the JSP, I use nested tags or the . notation (html:text property=search.name...) That way I can pass the SearchBean to a Dao Helper, ActionForm, or Business Logic Utility with a single get/set method. Mitchell, Steven C [EMAIL PROTECTED] Mitchell, Steven C [EMAIL PROTECTED] 07/08/2005 08:34 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Passing data between action forms I'm curious to hear what other people are doing regarding the passing of data between actions. Take for example an advanced search page with validation, drop down lists, the works. Upon successful validation the user should flow to a search results page. Assume the results page is part of something bigger that may require additional server-side processing. In the past I have put the search results list on the same action form as the search criteria and just forwarded to a different JSP from the same action. There are times when I would prefer to forward to a different action/form pair, especially if their is potential for additional processing. I suppose I could put the form in the session and define a different action that uses the same form to achieve some modularity, but I would prefer to be able to just hand-off the search results to a separate action/form pair. Is there an elegant way to do that in Struts? Am I just trying to make this overly complex?
Re: generate image by servlet for large amount of requests
maps.google.com uses AJAX to update their maps on the fly This allows you to display on the portion of the image that is required on the page. As you zoom in, out, of move around the map, they use a XML connection to update the map. http://en.wikipedia.org/wiki/AJAX Tony Smith [EMAIL PROTECTED] Tony Smith [EMAIL PROTECTED] 07/08/2005 11:32 AM Please respond to Struts Users Mailing List user@struts.apache.org To Tomcat Users List tomcat-user@jakarta.apache.org, user@struts.apache.org cc Subject Re: generate image by servlet for large amount of requests Any ideas? --- Tony Smith [EMAIL PROTECTED] wrote: Let's think about maps.yahoo.com. I do not know how they handle millions of request and generate the map pictures quickly. If I use a servlet, in the post or get method I use: BufferedImage mapImage = myTookKit.generateMap(String address); response.setContentType(image/png); OutputStream os = response.getOutputStream(); ImageIO.write(buffer, png, os); os.close(); Is servlet a good choice? If I use servlet, is the code above good enough to handle hundreds of request? Is the choice of BufferedImage a good one? What special technique I need to implement myTookKit to make it faster? I am thinking about JNI. Thanks, __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation and Display Question
To get the error appear next to the field add the following : html:messages id=error property=FIELD_NAME bean:write name=error / /html:messages to change the text of the field label (if your form is a table) ... td html:messages id=error property=FIELD_NAMEclass=error/html:messages Field label /td tdhtml:text property=FIELD_NAME/td td class=error html:messages id=error property=FIELD_NAME bean:write name=error / /html:messages /td ... Scott Purcell [EMAIL PROTECTED] Scott Purcell [EMAIL PROTECTED] 07/08/2005 02:58 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Validation and Display Question I am seeking some advice on the following: I have a site which uses the validator.xml and validation.xml files, and within the jsp pages, I am using the logic tag to display the messages. All works great, but I want to go further with my validation. Upon some investigating on other sites, I have noticed that some sites will actually change the text in front of textfields to a red along with a message about the error. I would like to be able to perform this type of error display, instead of the simple message that comes from the html:messages error, which is a list of problems. has anyone seen this done, or have any ideas where to begin with this? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Struts Tiles Question
All, I am using Struts Tiles to layout my site. I have a vboxmenu design which contains 4 menu levels: definition name=doc.menu.main path=/common/jsp/layout/vboxLayout.jsp putList name=list add value=common.menu.home / add value=common.menu.authenticated/ add value=common.menu.admin / add value=common.menu.logout / /putList /definition I am wanting to control when the Authenticated menu and the Admin Menu are displayed. For example, only display the admin menu if the user is in the Admin Role. I know that the taglib tld has a role attribute, but the dtd for tiles-def does not. Has anyone created anything simular with tiles?
Re: javascript
bean:define id=onClickUrl_javascript_:location.href=''/bean:define html:button property=Create value=Create styleClass=NPIButton / Vijay K Anand [EMAIL PROTECTED] Vijay K Anand [EMAIL PROTECTED] 07/06/2005 10:11 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: _javascript_ Hi All I used the same way you have said bean:define id=create_portfolio_javascript_:location.href=''/bean:define html:button property=Create value=Create styleClass=NPIButton % / html code generated is input type=button name=Create value=Create >_javascript_:location.href='' class=NPIButton but the problem is .do missing ... Any help brotheres? Bob Arnott wrote: Vijay K Anand wrote: Hi This code is not actually translating html:button property=Create value=Create styleClass=NPIButton > page='/portfoliomgmt'/\' / how do i do it? You can't embed tags in other tags... Off the top of my head try something like: bean:define id=onClickUrl_javascript_:location.href=''/bean:define html:button property=Create value=Create styleClass=NPIButton / Cheers, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Newbie: Where to put instance for database access?
Depending on the level of usage to the database, I would recommend implementing a connection-pool and requesting a connection each time you need to query the database. If you hold a single connection for your application, you will limit your scalability and hurt performance based on the user load. How you set up this pool is dependent on the database you are using and the resources you have available to that database. I would recommend looking at the Jakarta Commons-pool project. All of the major J2EE Appservers and most of the Java Servlet Container Servers support connection pooling. The only exception that I can think of off the top of my head is Sun iPlanet 6.0 or less. Tomcat will support connection pooling and has a decent how-to on their website. Aleksandar Matijaca [EMAIL PROTECTED] Aleksandar Matijaca [EMAIL PROTECTED] 07/06/2005 03:01 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Newbie: Where to put instance for database access? Create a singleton class, that holds the instance of a connection in a ThreadLocal class in that singleton -- this way you don't have to keep stuff in the session... Regards, Alex. On 7/6/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi! I have maybe a simple question: My web-app has to get data out of a database. I have a class DatabaseHandler which holds a connection to the database and provides methods to query it. I would like to have only one instance of this class in my web-app. But I don't know where to put it. Should it be stored in the ServletContext for application scope? But how do I access this instance from my Actions? Or would it be better to use data-sources? If I should use them, does anybody know a good tutorial on the internet? Perhaps hibernate would be a good choice too, but I think its a bit oversized for my application. You see - I am a total newbie concerning the use of databases with struts. Please help!!! Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] RE: J2EE vs .Net (was Struts vs .NET???)
Hopefully, this will trigger this to be an OT topic from this point forward. I have been ignoring this thread for the most part, but with all the postings figured I would glance over it. There are dozens of large Struts sites out there. I have worked on a lot of Enterprise Class websites that Use Struts. It is a solid viable framework solution which is easy to learn and implement. A few sites that I have been involved with: BlueCross / BlueShield TRICARE Call Center AHOLD USA MeadWestvaco Rockwell Automation All of these sites I consider large (Some running several hundred thousand transactions per hour and supporting thousands of simultaneous users). I am not knocking .NET or any other programming platform. There are many great examples of each of these available. But Struts is a framework will be around for a long time to come. JSF, SHELL, and others are building off of the lessons learn from this framework and will become just as popular over time. If you don't like Struts, Java, J2EE... fine, go on to .NET or what ever else you choose. The are all valid solutions with limitations and features that attract and deter based on what you need. But can we please get these emails back on track. I would prefer reading messages on tips, techniques, and problems rather than all this complaining. It is amusing to a point, annoying after that. David Suarez [EMAIL PROTECTED] David Suarez [EMAIL PROTECTED] 07/05/2005 09:28 AM Please respond to Struts Users Mailing List user@struts.apache.org To Dakota Jack [EMAIL PROTECTED], Struts Users Mailing List user@struts.apache.org cc Subject RE: J2EE vs .Net (was Struts vs .NET???) Can you guys start marking this topic OT? Seems like someone from PR is getting paid to hijack this mail group. Can some of the seasoned guys step in here so they'll pay attention? Regards...djsuarez -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED]] Sent: Sunday, July 03, 2005 1:54 AM To: Struts Users Mailing List Subject: Re: J2EE vs .Net (was Struts vs .NET???) Your discussion of a struts signature shows once again you don't have a clue beyond fairly simple amateur topics, Xu. On 7/2/05, John Henry Xu [EMAIL PROTECTED] wrote: Thank Yan Hu for giving this site. It seems they run on Netscape-Enterprise/6.0. However, I did not see struts' signature from there yet by trying to filling some forms. It looks like JSP-servlets handling form submision. One former site that used struts is reuters.com. Now they have redesigned/re-developed the site with Asp.net. Jack H. Xu Technology columnist and editor a href="">http://www.cppunit.org/article/index.jsphttp://www.usanalyst.com/a a href="">http://www.getusjobs.com/jobsite/index.jsphttp://www.getusjobs.com/a (The largest free job portal in North America) - Original Message - From: Yan Hu [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Subject: Re:J2EE vs .Net (was Struts vs .NET???) Date: Sat, 2 Jul 2005 11:20:30 -0700 (PDT) www.verizonwireless.com uses Struts... Check it out.. The site is slow. However, I do not think it has anything to with Struts. Struts has a relatively simple and clean structure. If a site that uses Struts appears slow, it's backend or middle tier must be lacking... People who often say Struts is slow do not know what struts really is. If JSF is proven to be as efficient as Struts, It will be a huge success. I am a big fan of JSF --- Leon Rosenberg [EMAIL PROTECTED] wrote: How large is large? I could show you some, but I need to know, what you define as large, to show you the right one. Doesn't struts project itself has a success stories page anymore? leon -Ursprüngliche Nachricht- Von: John Henry Xu [mailto:[EMAIL PROTECTED]] Gesendet: Samstag, 2. Juli 2005 18:30 An: Struts Users Mailing List Betreff: Re: Struts vs .NET??? Dakota Jack, Do you always accuse people don't understand framework if they don't agree with you? You need evidence to back up your claims. Show us some large struts web sites you had/have worked on so we can discuss them and technologies according to your claims. Jack H. Xu Technology columnist and editor http://www.usanalyst.com http://www.getusjobs.com(The largest free job portal in North America) - Original Message - From: Dakota Jack To: Struts Users Mailing List Subject: Re: Struts vs .NET??? Date: Sat, 2 Jul 2005 05:28:02 -0700 You only have this experience because you clearly do not even see what te framework does for you. If you don't see that, you see nothing. On 7/2/05, John Henry Xu wrote: The lines with Struts are in fact less, because you don't have to code the framework. That was an interesting statement. My experience was
Re: [OT]java bean question
From the javabean spec this is acceptable. However, it is not good coding standards to have a property in all upper case. The java standard naming convention has constance as all upper case, properties as camel case. Struts would have a problem with this because it is looking for the first letter of the property to be lowercase. if this is a procedure name it would be better to have the parameter as either p813name or procP813NAME. Ashish Kulkarni [EMAIL PROTECTED] Ashish Kulkarni [EMAIL PROTECTED] 07/01/2005 02:54 PM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject [OT]java bean question Hello I have java bean where in there is one property as below private java.lang.String P813NAME ; public void setP813NAME (java.lang.String P813NAME ) { this.P813NAME = P813NAME; } public java.lang.String getP813NAME () { return this.P813NAME ; } is this valid or not? if not why not and where i can find specification for java bean Ashish __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Exception - General Question
In 1.2.7 you simply change the ActionErrors to ActionMessages. you still save the errors with the saveErrors method and it works the same in the tags. Gaet [EMAIL PROTECTED] Gaet [EMAIL PROTECTED] 06/30/2005 04:54 AM Please respond to Struts Users Mailing List user@struts.apache.org To Mailing List Struts user@struts.apache.org cc Subject Exception - General Question Hi everybody, Up to now, I was handling my exceptions in my Action class as follow : ActionErrors errors = new ActionErrors(); try{ .. .. } catch (Exception e) { //Put print stack trace in System.err so it is logged e.printStackTrace(System.err); // errors.add(ActionErrors.GLOBAL_ERROR, new ActionMessage(errors.keyDescribingError : +e.getMessage())); saveErrors(request, errors); // Forward control to the appropriate error page forward = mapping.findForward(erreur); } However ActionErrors is now deprecated so I'm wondering if using ActionMessages instead is well appropriate. I have seen that a common use is to define an ExceptionHandlerseems to be nice as we just handke the errors in one place but : - It seems that using ExceptionHandler we lost the finest degree of the exception and we have not a personnalized message for the exception thrown. Of course, we could do a catch in the Action class and throw the exception with the personalized messaged but then I have another question : - Does ExceptionHandler slower than catching the exception in each Action class? Finally, What is the best practice to handle exceptions in struts? Thanks in advance for your help - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Architectural question
So long as the Action class is performing a truly generic function then I see no problem with this. Additionally, the name of the Action should reflect the function that is being performed. For example, if the action is forwarding a bean embedded in the form to a web service, the Action should be named something like PostWebServiceAction. However, if the action has logic built into it to determine which jsp is feeding the action and how to Interpret the data, this should be broken out. Mario Neè [EMAIL PROTECTED] Mario Neè [EMAIL PROTECTED] 06/29/2005 08:13 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Architectural question Hello, Does anybody knows if there is some problem in using single Action class to serve more Service ? XMoon load service automatically from xml but the Action class is the same. ex: action path=/console type=org.xmoon.GenericStrutsAction forward name=default path=/pages/console.jsp/ /action action path=/test type=org.xmoon.GenericStrutsAction forward name=default path=/pages/test.jsp/ /action -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Architectural question
I would name the actual action based on the functionallity: action path=/postRequest1 type=org.moon.PostWebServiceAction name=formTest1 forward name=default path=test1.jsp/ /action action path=/postRequest2 type=org.moon.PostWebServiceAction name=formTest2 forward name=default path=test2.jsp/ /action This would indicate that you are running two seperate web pages that both attempt to post data to a web service. The process for posting these requests are identical an therefor redundant to create two independent action classes to handle the business flow. however, based on the action path you are calling you can control the validation and forward differently. The key is that the code within the PostWebServiceAction does not contain any business logic, only deligating calls to other model functions. Mario Neè [EMAIL PROTECTED] Mario Neè [EMAIL PROTECTED] 06/29/2005 09:04 AM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: Architectural question following your example: action path=/PostWebServiceAction type=org.xmoon.GenericStrutsAction forward name=default path=.../ /action PostWebServiceAction.xml ?xml version=1.0 encoding=ISO-8859-1? service task code language=beanshell // business logic workbench.setForward(default); /code /task /service [EMAIL PROTECTED] wrote: So long as the Action class is performing a truly generic function then I see no problem with this. Additionally, the name of the Action should reflect the function that is being performed. For example, if the action is forwarding a bean embedded in the form to a web service, the Action should be named something like PostWebServiceAction. However, if the action has logic built into it to determine which jsp is feeding the action and how to Interpret the data, this should be broken out. Hello, Does anybody knows if there is some problem in using single Action class to serve more Service ? XMoon load service automatically from xml but the Action class is the same. ex: action path=/console type=org.xmoon.GenericStrutsAction forward name=default path=/pages/console.jsp/ /action action path=/test type=org.xmoon.GenericStrutsAction forward name=default path=/pages/test.jsp/ /action -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Mario Nee' Brescia Italy [EMAIL PROTECTED] http://www.xmoon.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Help me with my problem in Automatic Validation please
There are two approaches to correcting this. 1. If you are using Sessions, Place the datalist into the session instead of the request. This will insure the datalist is available, but can does add overhead to the application. Additionally, if you do not clean up the data, this can use up memory unnessicarily. 2. Instead of returning the page to the input page, set the input of the action to action1. This will return the page to the action that builds the input page instead of returning to the imput page directly. Thai Dang Vu [EMAIL PROTECTED] Thai Dang Vu [EMAIL PROTECTED] 06/28/2005 11:34 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject Help me with my problem in Automatic Validation please Hi everybody, This is the situation: welcome.jsp action1 ---(forward)--- dataform.jsp ---(submit)--- action2 view.jsp I use a drop-down list in dataform.jsp. The data for the list in dataform.jsp are got from an attribute attached to the request. I use automatic validation for dataform.jsp. When I go from action1 to dataform.jsp, I can attach a datalist to the request. My problem is: when I click submit in dataform.jsp and the data don't meet all the validation requirements, the request is forwarded back to dataform.jsp. At that time no datalist is attached to the request so the dataform.jsp can not display correctly. How can I solve this problem? Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]