RE: accessing from jsp to the size of a list property of my FormBean
Look at the logic:empty and logic:notEmpty tags... I think that's what you need. -Original Message- From: arnaud gonzales [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 12:42 PM To: user@struts.apache.org Subject: accessing from jsp to the size of a list property of my FormBean Hello, I would like to do something in my jsp if the size of the list property 'LAdressesLivraison' of my Form bean 'CreateAccesForm' is greater than 0: I can't have the size of my list like this logic:greaterThan name=CreateAccesForm property=LAdressesLivraison parameter=size value=0 do something /logic:greaterThan thanks in advance -- Cordialement, Arnaud Gonzales. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Difference between html:submit and JS submit.
That's because, by design, a javascript submit() call does not invoke whatever's established as the form's onSubmit action. It's not a struts thing, it's a javascript/web browser thing. In these situations, just call the validation function directly in your javascript, e.g.: function doIt(form) { if validateAddressForm(form) { form.submit(); } } HTH, - Scott -Original Message- From: Jim Reynolds [mailto:[EMAIL PROTECTED] Sent: Monday, November 07, 2005 2:49 PM To: user@struts.apache.org Subject: Difference between html:submit and JS submit. I posted this email a week ago, and received no response, so I am going to try again and change my verbage. Below is a JSP file which uses struts client-side validation. The validtion works great when you use either the html:submit or a normalinput type=submit. This is all good. Problem is, when you use legal javascript to submit the form, the validation does NOT work. Myself and other co-workers cannot understand why this is? Does anyone know why? The JSP file is below, and can easily be run and played with. I really was hoping someone had an idea why, because I would like to perform the client-side and need to change actions, etc. with JS. Thanks, IHere is the jsp page, in case one sees something odd: %@ include file=/tags.jsp % html:html locale=true head titlefyi/title html:base/ /head body bgcolor=white html:form action=/AddressJavascriptValidation method=post onsubmit=return validateAddressForm(this); td align=center colspan=2 font size=4bPlease Enter the Following Details/b/font /tr tr td align=right bName/b /td td align=left html:text property=name size=30 maxlength=30/ /td /tr tr td align=right bAddress/b /td td align=left html:text property=address size=30 maxlength=30/ /td /tr // HERE IS A LINK USING SIMPLE JAVASCRIPT TO SUBMIT THAT // FAILS. a href=javascript:document.AddressForm.submit()doit/a tr td align=right bE-mail address/b /td td align=left html:text property=emailAddress size=30 maxlength=30/ /td /tr tr td align=right html:submitSave/html:submit /td td align=left html:cancelCancel/html:cancel /td /tr /table /div !-- Begin Validator Javascript Function-- html:javascript formName=AddressForm/ !-- End of Validator Javascript Function-- /html:form /body /html:html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: newbie...but not stupid...so I thought
You're not specifying the form name in your action definitions. Not sure which action you're attempting to call, but add name=yourFormName to that action. -Original Message- From: Chris Pat [mailto:[EMAIL PROTECTED] Sent: Wednesday, July 27, 2005 3:38 PM To: Struts Users Mailing List Subject: Re: newbie...but not stupid...so I thought Hi Dave I second your analogies, grin. The NPE is happening on the first cast. Everything else looks fine. The fb is standard set/get made by JB05 wizard and looks normal. The struts-config has all the proper syntax for the required elements but in weird order, but there. Here it is. I am nonplused. ?xml version=1.0 encoding=UTF-8? !DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts Configuration 1.1//EN http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; struts-config form-beans form-bean name=header1 type=min03.forms.header1 / form-bean name=header1Form type=min03.forms.header1Form / /form-beans action-mappings action input=/header1.jsp path=/add1Action scope=session type=min03.actions.add1Action / action path=/delete1Action scope=session type=min03.actions.delete1Action / action input=/header1.jsp name=header1 path=/header1Action scope=session type=min03.actions.header1Action forward name=search path=/search1Action.do / /action action path=/listAll1Action scope=session type=min03.actions.listAll1Action / action input=/header1.jsp path=/search1Action scope=session type=min03.actions.search1Action forward name=results path=/result_list1.jsp / /action /action-mappings /struts-config --- Dave Newton [EMAIL PROTECTED] wrote: Chris Pat wrote: That is just a leftover. The retrieved form value is from the fast of the passed in form bean. Yeah, but where is the NPE happenning? What does the ActionForm look like? What does the struts config look like? It's fastiduous because non-fastiduous webapps rarely work. Maybe you meant irritating and repetitive? That's because Java and XML is like crack for people that like to type ;) Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] 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]
RE: Which button was pressed?
A warning about using property=submit for the html:submit tag... If you need to use javascript to programmatically submit forms (i.e. myForm.submit()), then using property=submit will cause you problems since you now have a form property called submit, which overrides the form's submit method. As I recall, the error message is obscure when this happens - pain in the a$$ to track down the cause of the bug. I would recommend using properties of submitBtn, renewBtn and replaceBtn instead - and then in your action class you just need to check for the existence of the parameter (i.e. not null) to determine which button was pressed. The value is not important in this case. HTH, - Scott -Original Message- From: Braun, James F [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 11:18 AM To: Struts Users Mailing List Subject: RE: Which button was pressed? Finally a question I can answer! Below is my code to do what you want. The value of the button pressed will be stored in the bean's submit variable (which you must create). The bean:message tag is there so that the button's title will be set according to the locale setting. app.submit, app.renew, and app.replace refer to the application resource file(s). J. html:submit value=submit property=submit bean:message key=app.submit/ /html:submit html:submit value=renew property=submit bean:message key=app.renew/ /html:submit html:submit value=replace property=submit bean:message key=app.replace/ /html:submit -Original Message- From: Thomas Sundberg [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 26, 2005 10:53 AM To: 'Struts Users Mailing List' Subject: Which button was pressed? Hi! I have a form where a user should be able to request a report. The user enters two dates and then presses either a button labeled pdf, html och csv. How can I read in my action which button was pressed? My form looks something like this: The button part of my form looks something like this: html:submit value=pdf alt=Create a pdf file/ html:submit value=html alt=View report as html online/ html:submit value=csv alt=Create a tab separated text file for import in Excel/ I haven't seen any good examples when looking in the docs and searching the web. I assume I wan't to add something to the html:submit, perhaps use the property tag(?), or can I be able to read the value of the button pressed? How do I read the value in my action? /Thomas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- This transmission is intended only for use by the addressee(s) named herein and may contain information that is proprietary, confidential and/or legally privileged. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or use of the information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. If you received this transmission in error, please immediately contact the sender and destroy the material in its entirety, whether in electronic or hard copy format. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: Fired???? was...Re: Struts Books Recommendations [OT]
It's a type of temporary work visa in the US. http://uscis.gov/graphics/howdoi/h1b.htm -Original Message- From: Daniel Perry [mailto:[EMAIL PROTECTED] Sent: Friday, July 08, 2005 5:33 AM To: Struts Users Mailing List Subject: RE: [OT] Re: Fired was...Re: Struts Books Recommendations [OT] Applogies for being english or maybe just naive, but what the hell is a H1B? Daniel. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Off topic threads
I personally don't mind them as long as they're flagged [OT] - that way, my email filters work and I can choose to read them when/if I choose. Besides - without these threads, we'd lose out on such timeless analogies like the 'mud-wrestling with pigs' comment! :-) - Scott -Original Message- From: Marsh-Bourdon, Christopher [mailto:[EMAIL PROTECTED] Sent: Thursday, June 30, 2005 9:44 AM To: 'Struts Users Mailing List'; Aleksandar Matijaca Subject: [OT] Off topic threads I know this would stifle the debate, but can we just stop the very off-topic debates on: My IDE vs. Your Text Editor Struts vs. Anything else (especially Microsoft) It's not Friday and it only encourages the trolls. It really doesn't have a place here. I personally do attempt (however poorly) to answer questions on Struts. I for one will remove myself for the list if I have to sift through this drivel for another day. Cheers Christopher Marsh-Bourdon www.marsh-bourdon.com -- -- The information contained herein is confidential and is intended solely for the addressee. Access by any other party is unauthorised without the express written permission of the sender. If you are not the intended recipient, please contact the sender either via the company switchboard on +44 (0)20 7623 8000, or via e-mail return. If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender. 3167 -- -- - 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: Populating the ActionForm without using the reset method?
It's pretty simple; you just need to populate the form bean and put it into request/session scope prior to forwarding to your jsp when in edit mode. You'll also need a hidden variable in your form to flag whether you're in edit or add mode, so your backend does the appropriate DB action. The mailreader example app that ships with struts shows the basic approach to doing this. I suggest that you look at that code and see how they do it there. - Scott -Original Message- From: Thai Dang Vu [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 10:27 AM To: user@struts.apache.org Subject: Populating the ActionForm without using the reset method? Hi all, Maybe I ask too much but I'm just a newbie in Struts and nobody in my department can help me :( This is my situation: I have an input.jsp page to let users enter data and click 'Save'. There's another function that the data is fetched from the database and users can modify them and then save them. I want to make only 1 jsp page to enter new data as well as edit the existing data (that is the input.jsp page). So what is the best way to write the input.jsp file so that sometimes its fields are blank (for inputing purpose) and sometimes its fields are populated with some values (for editing purpose)? For editing purpose, the values are undetermined beforehand so I couln't put them in the reset method. Sincerely. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Struts and Sessions Problem
As Michael alluded to in his response, a session will be created when the user hits index.jsp unless you explicitly specify session=false in the page directive. (See http://java.sun.com/products/jsp/syntax/2.0/syntaxref2010.html#15653) That's probably what's going on here. - Scott -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 29, 2005 12:04 PM To: user@struts.apache.org Subject: Struts and Sessions Problem Hello all! I have a problem with struts and sessions, perhaps someone has an idea: My web.xml contains the following welcome file list: welcome-file-list welcome-fileindex.jsp/welcome-file /welcome-file-list My index.jsp only forwards like this: %@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic % html body logic:forward name=cookiecheck/ /body /html My struts-config uses a global forward to map it like this: global-forwards forward name=cookiecheck path=/checkcookies.do redirect=false/ /global-forwards In the struts-config the final mapping to the action is this one: action path=/checkcookies unknown=true type=somepackage.CheckCookiesAction scope=request validate=false forward name=Failure path=/login.jsp redirect=false/ forward name=Success path=/home.jsp redirect=false/ /action In CheckCookiesAction which extends Action, in the execute(...) method I get the HTTPSession like this: HttpSession session = request.getSession( false ) ); My problem: when a user accesses my webapp for the first time this method does not return null, although it should do so! It is no problem of Tomcat 5.5.9 I am using, the Servlet I wrote for testing does its work properly and returns null if the user accesses my page for the first time. So why does Struts behave like this? Is it because of all the forwarding and redirecting, although it should have no effect in my opinion? Perhaps someone knows whats going wrong Peter -- MATERNA GmbH Information Communications Vosskuhle 37 44141 Dortmund Tel: +49-231-5599-8868 Fax: +49-231-5599-678868 [EMAIL PROTECTED] www.annyway.dewww.materna.de www.annyway.com www.materna.com Visit us at the following events: ACI EUROPE, Munich June, 22 - 24, 2005 ACI EUROPE, Verona September, 26 - 28, 2005 CTIA Wireless I.T. Entertainment 2005, San Francisco September, 27 - 29, 2005 Con4, Cologne September, 27 - 29, 2005 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Business Layer Ideas
We had to walk in the snow. And we couldn't afford snow boots, so we had to wrap newspapers around our feet! ...and they made us use Macs!!! ;-) -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 01, 2005 4:54 PM To: Struts Users Mailing List Subject: Re: [OT] Business Layer Ideas When I was going to programming school we had to walk to school and back and it was uphill both ways. On 6/1/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Wed, June 1, 2005 12:15 pm, Simon Chappell said: Back when I was a young programmer we used to have to think. THINK! Hey, I'm the resident bemoaner of how rough we used to have it! How dare you take my job?!? :) LOL Oh the humanity. No patterns for us. Just endless cups of tea, a pad of paper (or the back of long listings on greenbar) and your flowchart stencil. Stencils?!? I laugh at your stencils! It was only freehand drawings for us, and that was when we took the time to actually PLAN anything! We had it rough I tell you, but I think that we wrote better code back in those days. And those of us that came through them, still have a tendency to do so. I have said on numerous occassions that programmers that have never touched Assembly are, with few exceptions, not as good. And although the overall tone of my reply here is a joking one, this is a point I am serious about. I have actually rejected resumes because they had no Assembly experience. I'm not saying you have to be able to hand-code a 3D game engine, but at least have had some exposure. I spent a number of years doing absolutely nothing BUT Assembly, and while I honestly haven't done anything beyond some very simple subfunctions in the past 5-7 years or so, I wouldn't trade that experience for all the algorithm classes and patterns knowledge in the world. There is NOTHING like understanding, at least at a conceptual level, what's going on down there in the lower layers of your machine. Assembly gives you this. Like I said, there are exceptions to this rule, but I haven't met too many. My first computer had 1K, yes, that's 1024 bytes. Timex Sinclair 1000 by any chance? I loved that little thing! So much so that I spend $200 on one off eBay last year (three of them actually, with a lot of extras). The best thing about it was that if you could manage anything decent on it you were learning... I crammed the entire catalog of movie times for a week for Long Island in it... invented my own rudimentary compression scheme (although I had no clue what compression or algorithms were back then... never even heard the words... I was like 9 or so!). And I didn't have the 16K expansion module because my dad tried to solder it on because we could never get a good contact, but he fried it in the process, so I was stuck with the 1K (actually, now that I think about it, it might have been 2K. I'm not sure). We can only hope. Perhaps the prophesied return of Lisp will finally happen and people will discover REAL programming, not this Teach Yourself The Latest Junk in 24 Hours stuff. Real, worthwhile, programming is hard, so if your going to do it, study for it, and learn (LEARN I say) to do it well. I}hate}}}LISP. LISP... ugh. I can't stand any language that contains more parenthesis per 1,000 lines of code than ACTUAL CODE! :) Well done, Craig, with restrospect. A simpler designed framework like Struts is exactly the example, the proof, which Simon espouses above. Yes. Yes. Yes. Thank you Craig. I agree... There are probably architecural decisions in Struts I could complain about, but I think it would quickly become nothing but nitpicking. Craig did a rather good job IMHO of straddling the line between a good architecure that is flexible and extensible without making it too complex. Good job indeed, thank you! Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~ - 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: Double submit and Implied Save
This is more of a design issue, but I personally hate it (and find it dangerous in some cases) when anything is automatically saved for the user without their knowledge. What if I don't want my work on page A to be saved and really just want to go to page B? In situations like this, I prefer to prompt the user with a message like Any unsaved changes on this page will be lost. Do you want to continue? If they click ok, send them to page B. If they click cancel, nothing happens and they are then able to manually save Page A's data before moving on to Page B. You can even be intelligent about when to display this message with some javascript that inspects the form contents (and/or listens to onblur events) and only prompts the user if the form data has actually changed. - Scott -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 27, 2005 4:25 PM To: Struts Users Mailing List Subject: Re: Double submit and Implied Save From: Nancy Lin [EMAIL PROTECTED] 1. Here's our application requirement: when user modifies a page, say A and clicks on any other menu item or link, say B without clicking any button on the modified page A, page A needs to be automatically saved. If there is nothing wrong during save, end user should be redirected to page B, otherwise page A should stay with error messages. I do this by having 'onClick()' on the links submit the current form. Before the form submit, the javascript sets the value of a hidden form element that will tell me where they were trying to go. If there's an error, then the user is returned to the page with error messages. If not, the Action does whatever it needs to do, then decides where to forward/redirect based on that hidden field. -- Wendy Smoak - 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: AJAX: Whoa, Nellie!
I wholeheartedly agree that often times, simplicity is the best way to go for web (and webapp) UIs. However, end-user simplicity does not always imply developer simplicity (i.e. bare-bones HTML). Case in point: Google Maps vs. Mapquest, specifically in the Scroll Map use case. Which one is simpler and more intuitive for the user? For me, grabbing and dragging the map with my cursor (in any direction I desire) is more intuitive than clicking on arrow buttons to scroll the map (in N/S and E/W directions only). Sometimes it takes more developer effort/technology to create something that's easier to use. Sometimes it doesn't. But to say that client-side scripting is completely unnecessary for well designed application UIs is incorrect, IMO. It depends on what your users need to do. - Scott -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 19, 2005 10:48 AM To: Struts Users Mailing List Subject: Re: AJAX: Whoa, Nellie! Frank W. Zammetti wrote: On Tue, April 19, 2005 5:30 am, Jesse Alexander (KBSA 21) said: I also think that a well-designed web-UI does not need JS at all... Then what results is exactly what you say: a WEB UI. This was good enough five years ago, it isn't today. People expect, generally, more robust UIs delivered in a browser. They expect webapps that look, feel and work more like fat clients. This is all a virtual impossibility without some dergee of scripting. I, with respect for the author, disagree with this entirely. I am people, and this is not what I expect or desire at all. As a user, I expect and desire 1) A fast download 2) my bookmarks to work/easy to remember URLs 3) an organized and well-thought-out left rail 4) a go home link at the top 5) a two-field registration 6) an encrypted log on 7) content I can read in a text-only browser. None of these require any browser scripting at all. And most importantly, I want information that I regard as being of great quality. Anything beyond the seven I mentioned only gets in my way. Erik -- who prefers mail2web to GMail. There are of course cases where this doesn't natter... sometimes the simplistic Google front page approach is perfect. But you'll pretty quickly run up against some serious roadblocks to developing anything other than classic web UIs without scripting. Your point is well-taken... scripting does indeed entail some level of danger... but so does driving a car, and we all do that without much thought :) (which is of course part of the problem with driving today, but I digress...) - 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: Action Question
Should also point out that it's usually better to use mapping.getInputForward() in these situations (instead of defining a failure forward), since validator will always redirect the user back to the input location if there's a validation error (and this is usually the same place you want them to go for business rule violations). Only time you wouldn't want to do this is if you're sending the user to a different page/form to fix the business rule errors (e.g. rule overrides). But if the intention is to send them back to their original form with their original data, use the input mapping. - Scott -Original Message- From: Fogleson, Allen [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 1:26 PM To: Struts Users Mailing List Subject: RE: Action Question Before forwarding to failure try this... Action: Public ActionForward execute(Mapping mapping Form form, ...) { YourFormClass newuserbeanform = (YourFormClass)form; . . . boolean recordInsert = userbo.insertNewUser(); //By The way this looks backwards... I thought true was a success??? if (recordInsert) { request.setAttribute(newuserbean, newuserbeanform); actionforward = mapping.findForward(Failure); } else { actionforward = mapping.findForward(Success); } That will make the current form available to the jsp and it should show the data you have in it. Al -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 23, 2005 11:55 AM To: user@struts.apache.org Subject: Action Question Hello, I have a form, which has an attached bean. I am doing validation, so I have good data going to my action. In the action, I take the bean with good data, and hand it to a DTO object which updates the database with the new user supplied information. What can I do in the Action if my DTO object returns false (Could not update database because of some condition). I know I can find a mapping and send it somewhere, but the user just filled out a large form, and I would like to send them back to the form, where the data is, and show them a message there. I tried using the Failure (see below) but when it goes to the newUser.jsp page it is blank. The data they just entered is not there. I know how to do this in a ActionForm, but how in an Action? Here is my action mapping: action path=/newUser-submit type=com.ddi.dealer.action.admin.CreateNewUserAction name=newuserbean scope=request input=/jsp/admin/newUser.jsp validate=true forward name=Success path=/jsp/admin/mainAdmin.jsp / forward name=Failure path=/jsp/admin/newUser.jsp / /action Here is the action piece. BeanUtils.copyProperties(usersbean, userbo); boolean recordInsert = userbo.insertNewUser(); if (recordInsert) { actionforward = mapping.findForward(Failure); } else { actionforward = mapping.findForward(Success); } return actionforward; I just would like to be able to return them to their form where they just entered all the data, and let them try again. Thanks, Scott - 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: Output PDF
This intrigued me, since our app also has some generated PDFs. Sure enough, there's a double-get occurring w/ our IE clients (IE 6.0). Problem is that the USER_AGENT header for get #1 #2 are identical. In fact, the only difference I can see in all headers is that get #1 has an ACCEPT-LANGUAGE header, whereas get #2 does not. Everything else is the same So what gives? Did MS fix the wrong end of this bug in IE6? Is it safe to just look for the existence of the ACCEPT-LANGUAGE header? Thanks, - Scott -Original Message- From: Andre Van Klaveren [mailto:[EMAIL PROTECTED] Sent: Monday, March 14, 2005 3:39 PM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: Re: Output PDF I'm assuming that your browser client is IE. If so, the reason your Action is being called twice is because of a feature in IE 4.x+. If your application returns data that is to be handled with an ActiveX control (ie Adobe Acrobat Reader) the browser sends additional requests to the server. In IE 4.x and 5 it actually sends three requests. For IE 5.5+ it sends two. Assuming that your using IE 5.5+, the first request is the original request (duh), but then IE sends a second request to get the content-type. Who knows why they can't figure this out on the first request ;) This second request has it's userAgent header set to contype. You can solve this problem and increase the performance of your application by writing a Servlet filter that sits in front of whatever Actions you have setup to serve PDF content. Have this filter look at the userAgent header of each request. If it's set to contype just send an an empty response back to the client with the content type set to application/pdf. Simple as that. Now, the reason your getting an exception in the second code snippet you provided is because after you do your forward the JSP calls response.getOutputStream(). This is done behind the scenes but you can see it if you look at your generated Servlet code. This method can only be called once during the lifestyle of the request, hence your exception. It's generally a bad idea to have a JSP produce binary content anyway. They were designed for Text or HTML output. I wrote a generic/reusable Servlet whose sole purpose in life is to write binary content back to a client. I called it BinaryOutputServlet. You put your binary data (byte[]) and the content type of the data in the request scope and forward to it. It gets the data and content type out of the request and writes it back to the client. It can be used for any type of data this way. I would recommend doing something similar since Actions are really for control. By writing back to the client from an Action you are violating the MVC model anyway. I hope this helps. Oh, and you can read all about the feature of IE here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792 Virtually, Andre Van Klaveren, SCP On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer [EMAIL PROTECTED] wrote: I'm using Jasper to create PDF's through my Actions and cannot figure out a good way to export the resulting byte[] to the user. Currently the tail end of my Action class looks like this: byte[] reportBytes = null; File jasperReport = new File(location); try { reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(), parameters, dataSource); log.info(Found : + reportBytes.length); } catch (JRException e) { e.printStackTrace(); } response.setContentType(application/pdf); response.setContentLength(reportBytes.length); ServletOutputStream ouputStream = response.getOutputStream(); ouputStream.write(reportBytes, 0, reportBytes.length); ouputStream.flush(); ouputStream.close(); return(null); This will display the pdf, but the action class itself somehow get called a second time as the above log statement is displayed twice. I also tried to set the byte[] on the request and forward onto another page which does: % byte[] reportBytes = (byte[])request.getAttribute(REPORT_BYTES); response.setContentType(application/pdf); response.setContentLength(reportBytes.length); ServletOutputStream ouputStream = response.getOutputStream(); ouputStream.write(reportBytes, 0, reportBytes.length); ouputStream.flush(); ouputStream.close(); % But this complains about: getOutputStream() has already been called for this response Any ideas? -- Virtually, Andre Van Klaveren SCP - 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 ActionForward to HTML A NAME=xxx anchor
I don't think you can do it quite in the manner that you're attempting, but you can achieve this behavior by doing the following: - in your action class, populate a request attribute when this page refresh occurs - forward back to your jsp as normal - in your jsp, check for the existence of this request attribute. - if it exists, call a javascript function that sets the window.location.hash value to your anchor name. HTH, - Scott -Original Message- From: Brian Bezanson [mailto:[EMAIL PROTECTED] Sent: Friday, March 11, 2005 4:42 PM To: user@struts.apache.org Subject: Struts ActionForward to HTML A NAME=xxx anchor I'd like to know if it is possible to get a ActionForward to scroll my target page to an anchor on the page created with the a name=xxx/a. Problem Description -- I have a page in struts (rather large form) where I have a drop-down menu near the bottom with some choices. (AKA html:select and html:optionsCollection) When a user selects from that menu, I have a javascript.submit() that occurs where my page action retrieves data based on the menu change and populates another text block on the page below the pop-up. On the page being 'refreshed' it has set the scroll position to the top of the page -- which is the normal behavior. I'd like to return to a named anchor on the page by the drop-down menu. My Action.java code returns a return (mapping.findForward(myMessage)); In my struts-config.xml I also have the following: forward name=myMessage path=/Main/SomePage.jsp#name_reference/ In the JSP page (SomePage.jsp) I have: html:link linkName=name_reference/html:link But of course when I try and execute things, I get a 404 error:: HTTP Status 404 - /Main/SomePage.jsp#name_reference type Status report message /Main/SomePage.jsp#name_reference description The requested resource (/Main/SomePage.jsp#name_reference) is not available. Apache Tomcat/5.0.28 Removing the #name_reference from the struts-config.xml file gets things working again -- just no scrolling to my anchor point. Thanks in advance, Brian - 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: time validation mask (hh:mm)
Quid pro quo for answering my CSS post... :-) Just surround your pattern with start-of-line (^) and end-of-line ($) chars and you should get the behavior you desire: constant constant-nametime/constant-name constant-value^((?:0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9])$/constant-value /constant Incidentally, I came across this useful utility for regular expression testing called the RegEx coach: http://www.weitz.de/regex-coach/ Doesn't teach you anything about regex, but it's a great debugging tool. - Scott -Original Message- From: Matt Raible [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 1:09 PM To: Struts Users Mailing List Subject: time validation mask (hh:mm) I'm trying to validate that the proper format has been used to enter a 24 hour time. I'll admit I'm not a regex expert, but I thought the following would work. Actually, I got it from a regex expert friend, so I'm just assuming it should work. constant constant-nametime/constant-name constant-value((?:0?[0-9]|1[0-9]|2[0-3]):[0-5][0-9])/constant-value /constant However, this seems to allow alpha-numerics (i.e. 2:00p or 2:00x), when I only want digits in the first two places, followed by a colon, followed by two more digits. 24:59. If course, it'd be nice if users could enter 1:24 too, but that's not a requirement. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] CSS site/forum ?
Thanks for the link the offer, Leon. I was actually able to fix our issues once I realized that the root of problem was an apparently-well-know flaw in IE. In case anyone is interested, the flaw is that IE auto-adjusts box elements if contents of the box are wider than it's defined size (Firefox and most other browsers don't do this). We were unknowingly taking advantage of this behavior in our menus. So the fix for us was basically to be a bit more explicit in how the menu elements were defined. Not a big deal - we just didn't know what to look for. - Scott -Original Message- From: Leon Rosenberg [mailto:[EMAIL PROTECTED] Sent: Thursday, March 10, 2005 3:18 PM To: 'Struts Users Mailing List' Subject: Re: [OT] CSS site/forum ? Another recommendation: http://www.csszengarden.com/ Our biggest issue right now is that the ultra-cool dropdown menus we developed a while ago look great in IE, but are practically unusable in Firefox. Send me the code or an example i will pass it to our web designer. (Some days, you almost wish Firefox never got so popular and you only had to worry about IE. Heresy!) Not really, since you have to worry about explorer 5.0, 5.5, 6.0, 6.0 SP2 and, end of the year, 7.0 Not to mention netscape, firefox, safari, konqueror and opera. Regards Leon -Ursprüngliche Nachricht- Von: Scott Piker [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 10. März 2005 19:18 An: user@struts.apache.org Betreff: [OT] CSS site/forum ? Hey all, Sorry for the OT post, but I know a number of folks here are quite skilled with CSS. We're having some really annoying cross-browser CSS formatting issues and I was wondering if someone could direct me to a good site/forum where I could find common compatibility issues between IE and other browsers (Firefox, especially). (Some days, you almost wish Firefox never got so popular and you only had to worry about IE. Heresy!) Thanks in advance, - Scott - 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: Need Help Deciphering Error:
You have a typo there... valudate=true -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 02, 2005 2:43 PM To: user@struts.apache.org Subject: Need Help Deciphering Error: Hello, I am getting the following error and I cannot quite figure out what I am doing wrong? Can anyone give me some insight into this? Here is the circumstance: I have a jsp page that does a href to this action: /action/uploadAssets This will display a simple JSP page that shows a html form with some text and upload objects. When my struts-config.xml has this line: action path=/uploadAssets forward=/jsp/admin/upload.jsp / all is good and the site runs fine. But because I subclassed Action to have a isLoggedIn() to ensure the users are logged in, I want to use this: Therefore I can validate that the user is logged in in my LoginAction class then forward away to the page I want to go to. This is what breaks it: !-- Upload Action -- action path=/uploadAssets type=com.skp.action.LoginAction name=LoginForm valudate=true input=/jsp/myadmin.jsp forward name=Success path=/jsp/admin/upload.jsp redirect=true/ /action But as soon as I switch the above code for this code block I get the following error: Thanks, Scott javax.servlet.jsp.JspException: Cannot find message resources under key org.apache.struts.action.MESSAGE at org.apache.struts.util.RequestUtils.message(RequestUtils.java:814) at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:295) at org.apache.jsp.myadmin_jsp._jspx_meth_bean_message_0(myadmin_jsp.java:24 9) at org.apache.jsp.myadmin_jsp._jspService(myadmin_jsp.java:166) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:92) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja va:162) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:240) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:187) at javax.servlet.http.HttpServlet.service(HttpServlet.java:809) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:200) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:146) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:209) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:596) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 33) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:144) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:596) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 33) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:235 8) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :133) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:596) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:118) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:594) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :116) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:594) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 33) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:127) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:596) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 33) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:948) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:152) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:79 9) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:705) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:57 7) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:683) at java.lang.Thread.run(Thread.java:536) Scott K Purcell | Developer | VERTIS | 555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com http://www.vertisinc.com/ Vertis is the premier provider of targeted advertising, media, and marketing services that drive consumers to marketers more
RE: Checkbox problem again
nested:checkbox property=status value=S disabled=%myBean.isEnable%/ no errors thrown but It does nothing, it doesn't even outputs the disabled on checkbox html tag. does nothing means what? Nothing rendered, or does it render an input type=checkbox tag without the disabled flag? I think you want to use !myBean.isEnable(). - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: message-resources question
Yes, you can. Take a look at getResources(request) - Scott -Original Message- From: Scott Purcell [mailto:[EMAIL PROTECTED] Sent: Thursday, February 24, 2005 3:10 PM To: user@struts.apache.org Subject: message-resources question In an action class, can one get access to the message-resources? message-resources parameter=globalResources null=false/ I use the resources from JSP pages, but do not know if I can access them from a action class in the execute method? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tiles - a reality check (contains many details) - Am I using this thing right?
When using tiles this way, does this mean that any forward I define in my struts-config.xml should be a valid Tiles Definition? Would that then imply that every page in my application is specified by a tiles Definition, and that's how I GET to any given page? Yes, that's typically the way you would want to do it, but you're by no means forced to do it that way. Your struts-config can forward to a mixture of tiles-defs, JSPs, etc... but I prefer to keep everything tiles-centric. example: I want to create a Profile Editing page, so I create profileEditBody.jsp and a NEW definition in the tiles-defs file specifying only the TITLE and BODY ..a la definition name=page.profile.edit extends=base.definition put name=title value=Edit Profile Page / put name=body value=/jsp/profileEditBody.jsp / /definition Bue heres the question... how do I call this thing from an Action Class?!?!?! Argh just refer to the definition name in the action mapping your struts-config: action path=/showProfileEdit type=... forward name=success path=page.profile.edit/ /action HTH, - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionMessage without using a key from application.properties
You usually want to avoid doing this because you lose a lot of flexibility, but you can pretty easily simulate this behavior by just defining an empty message in your .properties file with one argument: message.custom={0} and then use the arg0 slot for your hard-coded custom message new ActionMessage(message.custom, Your custom message goes here); [EMAIL PROTECTED] 2/17/2005 3:58:57 PM Is there a way to construct a completely custom message without using a key from application.properties? ActionMessage constructor seems to insist on having a key that would be mapped to the application.properties. Thanks, JQ. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] Re: Need guidance in the presentation layer
Yes, it's pretty straightforward to do this with just lists and DHTML. You definitely don't need an applet for this. See: http://www.gazingus.org/html/Using_Lists_for_DHTML_Menus.html [EMAIL PROTECTED] 2/11/2005 9:47:36 AM Hi, I am having the problem of designing my main menu. My main menu (or at least I have designed like this) has two frames. left frame has all the options for the application. The options need to look like a tree structure where only the top level nodes are displayed. When the user clicks on a node, then the next level nodes are displayed. I have written an applet for this logic and is working fine but then I don't know how to connect each of the detail nodes from this applet to the corresponding jsp's? Is there any other way of doing this without an applet and frames? Thanks in advance, Vijaya - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Flow Control, Is there a good way?
Have you taken a look at the Struts Workflow extension (http://www.livinglogic.de/Struts/) ? [EMAIL PROTECTED] 1/26/2005 10:28:49 AM I am migrating to Struts from an existing webapp. One of the issues with the old architecture was managing the flow control logic. Currently we track in the session which flow and page the user is on. To enforce flow control each Servlet method must check the session to see if the flow and page are valid for input to that method. Needless to say this is a maintenance headache, obfuscates the flow and doesn't stand up well against the latest great idea from the marketing folks ;) First am I using the right vocabulary to describe the problem? If not stop here, the rest of my question is wrong. I have read two books (Struts in Action and Pro Jakarta Struts), read the users guide, developed a pilot-app and searched google. The only real resource I found on the matter was http://www.javaworld.com/javatips/jw-javatip136_p.html. Which despite the promising title is really only about double submit protection. Assuming I didn't miss the boat on how to do this ... The best I could come up with is to create my own Flow Control plugin which would read a config file that would specify the flow. This plugin would then intercept all requests to actions and validate them against the valid set of actions that could be executed give the specific user's flow and page position. Am I reinventing the wheel? Other thoughts on how to do this? Thanks for your time. -Kam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionMessages
How dynamic do you need the messages to be? Can't you just use argument substitution in your messages? e.g.: error.message={0} must be between {1} and {2}. new ActionMessage(error.message, fieldName, minVal, maxVal); [EMAIL PROTECTED] 1/18/2005 6:07:34 PM Anyone know how to pass errors from your Action to your JSP without having to use the resource file / ActionMessage combination. Basically I need to pass a dynamically generated error message to the jsp. Your help is appreciated. -Justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ActionMessages
How dynamic do you need the messages to be? Can't you just use argument substitution in your messages? e.g.: error.message={0} must be between {1} and {2}. new ActionMessage(error.message, fieldName, minVal, maxVal); [EMAIL PROTECTED] 1/18/2005 6:07:34 PM Anyone know how to pass errors from your Action to your JSP without having to use the resource file / ActionMessage combination. Basically I need to pass a dynamically generated error message to the jsp. Your help is appreciated. -Justin - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Struts Tiles and Internationalization
It's actually pretty straightforward. Just define a title attribute in your tiles-defs, as you would any other attribute. Override it for each page that requires a different title. For example: tiles-defs.xml: * definition name=app.base path=/tiles/layouts/baseTemplate.jsp put name=title value = app.titleKey / put name=headervalue = /tiles/header.jsp / put name=body value = /tiles/blank_body.jsp / /definition definition name=page.a extends=app.base put name=title value = pageA.titleKey / put name=body value = /pageA.jsp / /definition Then, adjust your templates so that your header tile renders the head and title html tags. Pass the title attribute into your header tile when inserting it: baseTemplate.jsp: * %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % tiles:importAttribute / html:html locale=true tiles:insert attribute=header tiles:put name=title beanName=title / /tiles:insert ... Then just use this attribute in your header.jsp. header.jsp: * %@ taglib uri=/WEB-INF/struts-tiles.tld prefix=tiles % %@ taglib uri=/WEB-INF/struts-html.tld prefix=html % tiles:importAttribute / head titlebean:message name=title//title /head ... HTH, - Scott [EMAIL PROTECTED] 10/27/2004 3:26:14 AM Hi all! I have a small problem: I am creating a web-application with struts, which contains many jsp-pages. At the moment I use the concept copy pasting the layout into each page. I read much about including parts by jsp-commands, templates and tiles and try to use tiles. But I do have one big problem with that: I have my template looking like that: TITLEtiles:getAsString name=title //TITLE /HEAD BODY tiles:insert attribute=head / tiles:insert attribute=content / tiles:insert attribute=footer / /BODY I know, it looks nice, but I have the problem, that each page has to choose another title, which is in my Ressource-Properties and to make it more complicated, I develop it with internationalization. I also have to use the title in the head-section, but I think the reuse is no problem. How can I configure a key, which will be resolved in the RessourceBundles to give me the language- and page-dependent title? Any suggestions? Bye Christian Verschicken Sie romantische, coole und witzige Bilder per SMS! Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message has originated from R.L. Polk Co., 26955 Northwestern Highway Southfield, MI 48034 R. L. Polk Co. sends various types of e-mail communications. If this email message concerns the potential licensing of a Polk product or service, and you do not wish to receive further emails regarding Polk products, forward this email to [EMAIL PROTECTED] with the word remove in the subject line. The email and any files transmitted with it are confidential and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete this message and notify the Polk System Administrator at [EMAIL PROTECTED] * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]