RE: JSF vs Struts
personaly i like the jsf-guys for tables (h:dataTable, h:panelGrid) there is NO need for adding table-specific-html (eg. trtd) during the loop, like html:iterate trtdbean:write ...//td.../tr /html:iterat see http://www.exadel.com/tutorial/jsf/jsftags-guide.html#column and http://www.exadel.com/tutorial/jsf/jsftags-guide.html#panel same with display-tag (http://displaytag.sf.net) on using struts/jsp, regards, matthias -Original Message- From: Jeff Stewart [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 7:40 AM To: Struts Users Mailing List Subject: Re: JSF vs Struts I've been monitoring this discussion. I for one like using the struts html tags over the JSTL/JSF semantically strange tags. For one thing, feedback from the HTML developers I work with, prefer html:interate this over the {c:jstl } garboono. I mean, isn't this a big motivation why Struts was created. Craig McClanahan wrote: On Sun, 18 Jul 2004 23:56:55 -0400, Rick Reumann [EMAIL PROTECTED] wrote: Craig McClanahan wrote: For applications you are about to start on, if it is your intent to use the Struts HTML tags for your view tier, you should review that decision in the light of the developments of the last few months, since the JSF spec went final, to say nothing of the availability of alternative view tier technologies (XML, Velocity, ...) that work with Struts as well. If these tags work for you, that's fine ... but be aware that you are buying in to a mature technology that is unlikely to change much in the future. Craig, can you elaborate on this a bit more? I'm confused because if you went with a different front end presentation other than JSP and Struts HTML form tags, why would it matter that you chose Struts HTML tags for the JSP portion? If you choose Struts HTML tags for your presentation, you're stuck with what Struts provides. Since Struts has no user interface component model of its own, that has led to a variety of ad hoc solutions for more complicated requirements. If you choose JSF components, not only are you not stuck with what Struts provides (because the JSF API standards are common -- and there will be ***lots*** of third party components built on top of this standard), you're not stuck with JSP either. See below for more. If you later chose an XML/XSLT or Velocity (yuk:)solution for your view you'd end up scrapping the JSPs altogether anyway so why would it matter what tags you used to build the JSPs that you would be replacing? Or are you basically saying to not even bothr using JSPs for a front end view? (I've seen good velocity templates and I'll take a *clean* JSP using JSTL and tags over Velocity any day of the week). Thanks for your thoughts and all your work on Struts, JSF, Tomcat, etc. The Struts HTML tags are very much specific to JSP ... indeed, their very implementation is as instances of JSP custom tags. You can't use them at all without buying in to JSP as a display technology. And, for various reasons, more than a few loudmouths :-) in the Java community do not like JSP at all. With JSF, however, the situation is different. Every JSF component is, at its core, just a JavaBean ... it doesn't care what technology is used to ultimately manage the page. Yes, we provide JSP tag wrappers around all the standard components (because that addresses the need of a very large portion of the marketplace), but it's not required. The reason is that JSF provides a pluggable ViewHandler implementation ... the default one does RequestDispatcher.forward() calls (just like Struts does), making it very easy to use JSP, but this is by no means required. You like Tapestry style separation of the component tree definition from the static HTML text? That's not hard ... go get Hans's JSF book and read the last chapter, to get you 80% of the way to a robust ViewHandler solution. Maybe you'd prefer XForms? Go for it ... writing a ViewHandler that transforms your favorite way of representing a component tree into an XForms document is MMP (Merely a Matter of Programming :-). Or, maybe you'd prefer an XML based solution that has all the component stuff in a single file, and you're contemplating an XSLT based solution that transforms component definitions into the corresponding HTML. Go for it. (Of, course, if you use the XML syntax for JSP pages plus JSF component tags, you get this pretty much for free ... oops, sorry, forgot you might be one of those that doesn't like JSP :-). The basic point is, JSF is not restricted to using JSP as the view tier ... although, for obvious market share reasons (the number of current Java developers that use JSP dwarfs the number that use other view technologies) JSF makes this very easy. -- Rick
Re: JSF vs Struts
On Sun, 18 Jul 2004 23:40:08 -0600, Jeff Stewart [EMAIL PROTECTED] wrote: I've been monitoring this discussion. I for one like using the struts html tags over the JSTL/JSF semantically strange tags. For one thing, feedback from the HTML developers I work with, prefer html:interate this over the {c:jstl } garboono. I presume you mean logic:iterate, not html:interate (which doesn't exist :-). I mean, isn't this a big motivation why Struts was created. No, that's *not* at all why Struts was created. The primary reason Struts was created was to enable application developers to employ a web application architecture based on model-view-controller principles ... in particular, enabling the separation of the controller tier from the view tier. When Struts was created, there were no commonly accepted design patterns for that separation. The custom tags that Struts provides (in the html and logic and bean tag libraries) were a necessary precursor to out of the box usage of Struts, in order to make it possible to adopt the basic MVC architectural pattenrs. However, that was *always* a secondary feature in the original vision -- the important part was separation of the view tier logic from the business tier logic. Craig McClanahan (Original creator of the Struts framework) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
From terry highfield: Invitation and new email address
A Friendly Invitation http://www.sms.ac/registration/Intro.aspx?InviteId=7bfa85y08c00xe4gk071 al5347kupd9oq6jrxjt0tc025 Hey [EMAIL PROTECTED], terry highfield has invited you to sign up, so that you can send FREE SMS (text messages) to each other: Click here http://www.sms.ac/registration/Intro.aspx?InviteId=7bfa85y08c00xe4gk071 al5347kupd9oq6jrxjt0tc025 to accept your invitation now. important New mobile email address for terry: [EMAIL PROTECTED] * Please note this for your records. This new email address is effective immediately. By sending emails to [EMAIL PROTECTED], your friend will receive your emails on his/her mobile phone. You will get your own FREE spam-free mobile email address too when you accept your invitation http://www.sms.ac/registration/Intro.aspx?InviteId=7bfa85y08c00xe4gk071 al5347kupd9oq6jrxjt0tc025 . Your friend is waiting to hear from you. Have fun at the world's most popular mobile community - SMS.ac! - terry highfield, and your friends at SMS.ac SMS.ac is a spam-free company. This invitation was sent to you by terry highfield, who thought you would like to recieve free mobile phone text messages (SMS) using SMS.ac.
Re: [OT] JBoss, Jaas and Struts
Dang I thought I was onto something! I guess I'll stick to my User object in each session, and just try to make sure I centralize the auth checks as much as I can. Dunno why I ever wanted to change it, anyway. Thanks Craig for your time. Erik Craig McClanahan wrote: On Sun, 18 Jul 2004 21:50:19 -0400, Erik Weber [EMAIL PROTECTED] wrote: So, I am trying to use the JAAS implementations that JBoss provides, which are configurable via login-config.xml. Now, if you configure that file appropriately and create a login page that follows the J2EE specs for container-managed login (the form action is j_security_check, the username field is called j_username and the password field is called j_password), the container does indeed propagate the authenticated subject to the web-app environment somehow; you can use the methods such as request.isUserInRole successfully. However, with the form action having to be set to j_security_check, you lose the link to the Struts controller, and thus give up Struts stuff like form validation, error redirecting, etc. That is as it should be. When you create a form login page (for container managed security), what you are essentially doing is designing a page that is part of the *container*, not part of your *application* -- in other words, the only thing you get to do is make the login page visually look like the rest of your app. It is not, in any way shape or form, actually part of your app. Therefore, you can't assume things like Struts validators. To grasp this more fully, switch your app to use BASIC authentication instead of FORM, so that the browser pops up its login box. See how you don't have any way to specify validators on the input dialog, or control where the input goes? That's because form based login is an exact analog to that procedure. So I toyed with the idea of bridging my Struts login page (action != j_security_check) with the container, by somehow processing the form submittal on my own, but then forwarding the username and password as j_username and j_passsword to this j_security_check resource, but I couldn't figure out how to do it. I even went so far as opening an HttpURLConnection to http://localhost:8080/j_security_check; and setting the username and password as request parameters, just to see if it would work. Yeah, it's been a long day. Anyone have an idea on this approach? Yah, I do ... give up on expecting any portable solution that will work across servers. The current specs do not provide for that, although there are current JSRs under way to address that precise concern. So I went the route of the typical examples; I wrote a login Action that instantiates a LoginContext using the domain I have configured in login-config.xml, provided my own CallbackHandler to submit the username and password, etc. And the login method does work -- it does authenticate using the database I specified in login-config.xml, but yet somehow the Subject is not propagated to the web-app environment the way it is when you login using the form action j_security_check, and so I still cannot use the methods such as request.isUserInRole. So obviously whatever intercepts the call to j_security_check is not only doing authentication, but it is taking some extra step to let the container know that the user has been authenticated. I know this is true because the request.isUserInRole method works when I do it that way. I iterated all the session attributes and there are no new ones present after authenticating with j_security_check. Does anyone know what this missing step is, and how I can do it from my own code? Or am I wasting my time? If you want to use Struts features in your login page, you'll need to abandon container managed security. Perhaps something like SecurityFilter (a sourceforge project) might be useful to you -- but, if you're using EJBs and need the propogation of user identity from the web tier to the EJB tier, this is not likely to work. The only possible solution would be something your app server itself provides. Thanks if you even took time to read this! Erik Craig - 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]
validatewhen with a regular expression
Is is posible to use validatewhen in conjunction with mask? I cannot figure out how to make it work. Separately they work fine, but when I try to use them together it never validates. Here is the non-working config. form name=dynaPhoneNumberForm field property=phoneNumber depends=validwhen,mask arg0 key=phoneNumber.displayname / var var-nametest/var-name var-value(submit == 'delete') or (*this* != null)/var-value /var var var-namemask/var-name var-value^\d{4}-\d{4}$/var-value /var /field /form I'm using a LookupDispatchAction, and if I am calling delete, I do not send the phoneNumber field. If I am not deleting, then I would like to validate this against a regular expression. And, yes, the regex is working OK - they are not U.S. phone numbers. -- Matthew Van Horn [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts response character encoding.
sn, 18.07.2004 kl. 22.23 skrev Jason Lea: Olve Sther Hansen wrote: Now I am saying false things. I thought my baseLayout.jsp had this entry.. It didn't. So it is enough specifying %@ page contentType=text/html; charset=UTF-8% in the base tiles file if that architecture is used. I think it that should work. But I think I ran into a problem when pre-compiling the JSP pages when using the 2.3 spec. If you don't pre-compile I think it should be ok. If you do pre-compile, each JSP is passed to the compiler and the compiler does not know the encoding, so it uses the default. This is why I ended up adding it to all pages. I ended up using the directive for all jsp's containing non-ascii utf-8 characters.. Most messages are retrieved through the resource properties, but when I am lazy, I write things directly in the jsp. Thanks for the help! -- Olve Sther Hansen [EMAIL PROTECTED] Systems developer - National english reading tests Intermedia/Aksis - Unifob http://www.intermedia.uib.no - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Connection
Hi All I am using a JSP Struts application which is already developed. I am using Websphere. Sometimes I get ConnectionWaitTimeOutException. I am sure there are some connection leaks. Which tool/method should we use to find out these connection leaks Pls help Thanks in advance Shashank S. Dixit. This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorised review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful. Visit us at http://www.cognizant.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Connection
Hi Shashank There are lots of freeware tools available in net like Bugfix...you can also use JProbe for a better analysis of all the memory and connection leakages. regards Gnanavel M | Accenture India Delivery Center MDC2B | [EMAIL PROTECTED] | 91.22.5500 3409 Direct Voice | mgnanavel AIM Dixit, Shashank (Cognizant) To: [EMAIL PROTECTED] [EMAIL PROTECTED] cc: om Subject: Connection 07/19/2004 06:17 PM Please respond to Struts Users Mailing List Hi All I am using a JSP Struts application which is already developed. I am using Websphere. Sometimes I get ConnectionWaitTimeOutException. I am sure there are some connection leaks. Which tool/method should we use to find out these connection leaks Pls help Thanks in advance Shashank S. Dixit. (See attached file: InterScan_Disclaimer.txt) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts response character encoding.
There this system property you can set but I can't remember it, it's used as the encoding to use when reading files... Anyway, I always edit my .jsp and .properties using UTF-8, then pass them through the native2ascii ant task during my build. It's just a wrapper for the same-named JDK binary; you can use that directly if you dont use Ant. Works great. hth, Manos Olve Sther Hansen wrote: I have some problems using struts/tiles and UTF-8 characters embedded in an jsp page. How can I make struts/tiles respect the system default encoding, and not use iso-8859-1 for all jsp pages? This problem occurs in tomcat 4.1.29, 5.0.19 and 5.0.27. I have a struts version bundled with Appfuse, all I know is that it is from 2003-12.02 (that is 2. december). It seems like struts is hard-coding the response encoding to be ISO-8859-1, although the response-encoding is set to be UTF-8 for all requests.. In a struts-action I execute this code: log.debug(res encoding: +response.getCharacterEncoding()); log.debug(req encoding: +request.getCharacterEncoding()); resulting in: res encoding: ISO-8859-1 req encoding: UTF-8 I use the SpringFramework characterEncodingFilter to force utf-8. My web-browser reports the page to be encoded in utf-8. If I use iconv (a Linux program for converting files from one encoding to another) to convert a file containing utf-8 characters (norwegian characters ) to iso-8859-1, the pages displays correctly. My web-browser still reports the page as being encoded in utf-8. If I write the same Norwegian letters in a jsp page outside of struts/tiles control, the page displays without problems.. So, is there a way to make struts/tiles respect the system default encoding, and not use iso-8859-1 for all jsp pages? Hope someone can help me solve this problem, I have looked through most email archives I can find without any solution. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF vs Struts
Craig McClanahan wrote: With JSF, however, the situation is different. Every JSF component is, at its core, just a JavaBean ... it doesn't care what technology is used to ultimately manage the page. Yes, we provide JSP tag wrappers around all the standard components (because that addresses the need of a very large portion of the marketplace), but it's not required. The reason is that JSF provides a pluggable ViewHandler implementation ... the default one does RequestDispatcher.forward() calls (just like Struts does), making it very easy to use JSP, but this is by no means required. You like Tapestry style separation of the component tree definition from the static HTML text? That's not hard ... go get Hans's JSF book and read the last chapter, to get you 80% of the way to a robust ViewHandler solution. Maybe you'd prefer XForms? Go for it ... writing a ViewHandler that transforms your favorite way of representing a component tree into an XForms document is MMP (Merely a Matter of Programming :-). Or, maybe you'd prefer an XML based solution that has all the component stuff in a single file, and you're contemplating an XSLT based solution that transforms component definitions into the corresponding HTML. Go for it. (Of, course, if you use the XML syntax for JSP pages plus JSF component tags, you get this pretty much for free ... oops, sorry, forgot you might be one of those that doesn't like JSP :-). We're thinking about using Flash forms for some things. Will they plugin nicely to JSF? -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Fwd: Multipart forms
Hi! I have a problem when I want to get some parameters in the reset() method of an ActionForm. If the form is a normal form, then I simply call request.getParameter(myparameter) and the parameter is retrieved with no problem. But if the form is of type multipart, then I always get null. The parameter table seems to be filled later, on the RequestProcessor. I need to get parameters in the reset() method, specifically the page parameter, to deal with checkboxes in my wizard-style multipage form. How can I do it in the simplest way possible? Thanks in advance. This message was sent using IMP, the Internet Messaging Program. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF vs Struts
At 01:01 AM 7/19/2004, you wrote: The custom tags that Struts provides (in the html and logic and bean tag libraries) were a necessary precursor to out of the box usage of Struts, in order to make it possible to adopt the basic MVC architectural pattenrs. However, that was *always* a secondary feature in the original vision -- the important part was separation of the view tier logic from the business tier logic. Craig McClanahan (Original creator of the Struts framework) As an original historical matter, it would be hubris of the highest variety to question you on this, Craig. As a historical consequence, however, I for one think that this turned out to be the more revolutionary result of struts, leading coding into taglibs in a way not seen before. The controller and MVC (of sorts) pattern in Struts existed in all sorts of forms prior to Struts. Struts did it better than most, maybe better than all the rest, and provided a standard that people could code to. But, those tags were just a big surprise in the way they hit the market. I, for one, now code tags as readily as I code classes. Not as many, of course, but they are a definite weapon in my quiver. A big reason for that is that I could code using Struts taglib code as a learning and doing mechanism together. Blah, blah, blah. This is not meant to be particularly profound. But I did want to give this boost to the tags in Struts. I think they have been very important to Java. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Question on parameterizing action attribute to html:form
Andrey Rogov wrote: there is another way to work with parameter form:action. If you use Tiles in your applications create one reusable tiles lay with elements of design, control buttons and page control. In this case you can use the page with many forms. Then solution html:form action=${myFormBean.the_action_URI}/ can be replaced with html:form action=${ControlBean.the_action_URI}/ . What do you think ? Sure that could work (using Tiles or Sitemesh), but I'm not sure you gain that much by having a tile/include contain a header htm:form action=${ControlBean.the_action_URI}/ on it versus html:form action=${myFormBean.the_action_URI}/. I probably wouldn't make a whole seperate tile just for the html:form header. Most of the time I don't need to dynamically change the action name since the reusable form usually always has the same validation rules (an update versus and add for me usually has the same data on the page.. sometimes hidden though). I also find it easier to understand when you can quickly look at the JSP and see the action name delcared in the form element. Since I'm now leaning towards manually calling the validate methods anyway (to avoid those issues of having to repopulate lists when validation fails), I can always create custom validation calls based on whether I'm doing an update versus an insert if I need to. This why the Action name always remains the same on the form. Obviously many ways to skin a cat here. I tend to avoid having dynamic action names since some time a year later someone will say When I'm on such and such a page and click submit, I'm getting this wierd error. To track down the problem it's easy then to just look at the JSP and see the action it's submitting to. When it's dynamic it's a bit more of a pain to track down what is going on. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[OT] javax.COMM
Anyone have any info on open source projects with javax.comm? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] JBoss, Jaas and Struts
Erik Weber wrote: Dang I thought I was onto something! I guess I'll stick to my User object in each session, and just try to make sure I centralize the auth checks as much as I can. Dunno why I ever wanted to change it, anyway. Thanks Craig for your time. I also sent your question on to a co-worker and he had this to say... Craig if you have any comments regarding below I'd be interested in forwarding on to my co-worker here as well. Thanks. == This very topic has given me plenty of headaches. Only by diving into the Tomcat code did I start to figure out what was going on. The issue is that the login must happen in two places since both JBoss and Tomcat security were designed to work standalone. JBoss accomplished the integration of the two by hacking Tomcat to use JBossSX as a security realm while allowing Tomcat to continue collecting its own login credentials. When you performed your JAAS login within your action, you only authenticated yourself with JBoss. Since doing so bypassed the aformentioned hack, Tomcat never authenticated and the user principal was never applied to the session. I had a very similar issue not too long ago and when I finally figured out how JBoss/Tomcat integrated, my brain started spinning trying to figure out how to do a more intelligent form login through the JBoss/Tomcat stack. Fortunately form authentication wasn't a requirement for the immediate problem so I didn't put too many cycles on that problem. The moral of the story is that you can't bypass j_security_check without cutting Tomcat out of the authentication loop. You can't proxy j_security_check either. I tried some VERY creative hacks that way and none of them worked. Tomcat was designed specifically to not allow it. Too many potential exploits there. There is a possible solution if you're willing to apply a little elbow grease and bend the JAAS spec a little. Download the Tomcat source and take a look at org.apache.catalina.authenticator.BasicAuthenticator. That's a good reference for how Tomcat authentication works. Now take a look at the FormAuthenticator in the same package. This one is a bit more complex in that it saves the initial request so that it can replay it once authentication is complete. It is conceivable that you can write a StrutsFormAuthenticator that forwards to the ActionServlet to collect the credentials. Once you have your new authenticator, you can register it by adding it to org/apache/catalina/startup/Authenticators.properties with a key like STRUTS. Now go back to your web.xml and replace FORM with STRUTS and next time Tomcat deploys your war it should load up with your custom authenticator. Be aware that JBossWeb has its own shadows of Tomcat authenticators (the aformentioned hacks). Instead of extending Tomcat classes directly, you must extend these and you must patch the org/jboss/web/tomcat/tc4/Authenticators.properties file in deploy/jbossweb-tomcat41.sar/tomcat41-service.jar with your STRUTS reference. Good luck! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
nested tags and bean population
In my form bean I have an array list called categories that contains objects of type Category. Each Category object contains an array list of Steps. So in my jsp I am rendering this relation as follows: nested:iterate indexId='idx' name='auditmaster' property='categories' id='cat' type='com.securance.vo.ApStepCategoryVO' h3nested:write property='category'//h3 br nested:iterate name='cat' property='steps' id='step' type='com.securance.vo.ApStepVO' nested:textarea property='step' cols='65' rows='2'/br /nested:iterate /nested:iterate First I iterate through the Category array list and then for each Category I iterate through the steps array list in each category. This renders just fine. The problem is that when a user edits each step and submits the form, only the stesp for the first Category get updated. The rest remain unchanged. I need for the user to be able to edit everything and then submit the form and have the edits be reflected in this nested relationship. Thanks in advance - Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign!
RE: some best practices questions
-Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 08:37 To: Struts Users Mailing List Subject: RE: some best practices questions People seem to treat using the session as though it were some kind of moral sin. There are technical pros and cons to using the session and these should be considered when you do your coding, but the session scope is not harem. You wont be cursed with eternal damnation because you shove a couple of dropdown lists in the session for a while. It just has implications for performance/scalabilty in certain situations that mean that avoiding its use is often advantageous. (Such as the posibilty that a while could translate to until the session times out, and that if your in a clustered environment the container may need to serialise the session around between machines quite often) Usually those considerations are due to the fears that the host machine or application will crash with a very high volume of simultaneous users. For example it is not a good idea to store large bitmapped images, say from a 5.0mega pixel digital camera in a HttpSession directly or indirectly for each web user. You are asking for trouble if you suddenly architect a load balancing solution. Doing 'wierd stuff' (tm) in application scope or on the file system in an effort to reproduce the effect of a session seems a bit dodgy to me (ie: surely the container is far better at implementing sessions than you are!). Now if its because you have thought it through carefully and logically and that in this case it really is better to do it this way then thats a different matter, but if its just due to some instinctive ideological aversion to using the session api, well thats just nuts. Having said that you probably want to use a generic caching solution, basically any lease-time based cache that uses a map collection behind the scenes to cache images in my digital photostore example. You would put a global image cache in the application scope (Servlet Scope) and then all of the web application can access the cache. Also you would set an expiration time to be greater than 30 minutes or higher than the session timeout, or what is the point I can see a place for lease time cache (LRU or otherwise) that sits between the HttpSession (30 mins by default) and the application scope (infinite or until the web container / server is restarted or die) For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. Alternatively behind the scenes put the cache in the DAO layer or services layer. You can also rely on the OR/M framework to do this for you if it is intelligent to cache similar queries and result sets. my 2c -Andrew -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, 8 July 2004 13:09 To: [EMAIL PROTECTED] Subject: RE: some best practices questions I think, performance wise File I/O is not the right idea. What do you say ? -Original Message- From: Christina Siena [mailto:[EMAIL PROTECTED] Sent: Thursday, July 08, 2004 8:16 AM To: Struts Users Mailing List Subject: Re: some best practices questions I have an idea how to persist the data that I currently place in session scope but I need to run it by someone. Recall when I said that placing data in session scope is frowned upon by some members of my team? Well no one said anything about not using Java serialization. Why couldn't I serialize the same data that I currently keep in session scope? I've already implemented a solution for streaming images so creating a temp file should not be a problem. Here is what I think I will need: In the action where the data is first retrieved: try { final String prefix = myVehicleLineMap; final String suffix = null; File file = File.createTempFile(prefix, suffix); FileOutputStream fileOutputStream = new FileOutputStream(file); ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream); objectOutputStream.writeObject(myMap); objectOutputStream.flush(); myForm.setTempFileName(file.getAbsolutePath()); } catch (Exception e) { System.out.println(this.getClass().getName() + == + e.toString()); } In the action where the data needs to be re-accessed to prepare the page for re-display: try { FileInputStream fileInputStream = new FileInputStream(myForm.getTempFileName()); ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); SortedMap myMap = (SortedMap) objectInputStream.readObject(); // use myMap as before (when in session scope) } catch (Exception e) {
RE: some best practices questions
-Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 09:14 To: Struts Users Mailing List Subject: RE: some best practices questions At 12:36 AM 7/8/2004, you wrote: For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. my 2c The thing is, though, Andrew, these are recurrent issues and seem to require a generic solution. Having a small manager in application scope which can create and monitor a scope which is not application, not session, and not request, is worth the while for these recurrent problems, I think. The persistence of such a scope can be made a function of the data rather than the interest of the clients. That is worth having to use on a general basis, I think, and can be done with a very small performance hit. In fact, my guess is that it would be a performance plus. Michael Well this is astounding, because I looking at JCache JSR whatever? and looking at alternatives like OSCache for a caching the look up of login user accounts. So where the hell is JCache or the standard. If it was there, I think it would give you what you want? -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44 (0)207 883 4447 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested tags and bean population
Juan Alvarado wrote: In my form bean I have an array list called categories that contains objects of type Category. Each Category object contains an array list of Steps. So in my jsp I am rendering this relation as follows: nested:iterate indexId='idx' name='auditmaster' property='categories' id='cat' type='com.securance.vo.ApStepCategoryVO' h3nested:write property='category'//h3 br nested:iterate name='cat' property='steps' id='step' type='com.securance.vo.ApStepVO' nested:textarea property='step' cols='65' rows='2'/br /nested:iterate /nested:iterate First I iterate through the Category array list and then for each Category I iterate through the steps array list in each category. This renders just fine. The problem is that when a user edits each step and submits the form, only the stesp for the first Category get updated. The rest remain unchanged. I need for the user to be able to edit everything and then submit the form and have the edits be reflected in this nested relationship. Hey Juan. What does the source code look like? I think the source code will reveal a lot. Are you sure your collections aren't getting pulled from some other scope other than the form bean? Also I never use name or the type in my nested:iterate loops. I think that could be the problem. If you use name it will look for that 'name' of the collection in scope. You want to make sure you are using the collection that is nested inside of the other one. If you remove name and type and it still doesn't work that will reveal a lot of the problem. For example if you have a Collection of categories (of ApStepCategoryVO) in you form bean you should be able to do nested:iterate property='categories' id='cat' h3nested:write property='category'//h3 br nested:iterate property='steps' id='step' nested:textarea property='step' cols='65' rows='2'/br /nested:iterate /nested:iterate -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: some best practices questions
My comment would be that *data* caching should be done in the data layer (like ibatis, hibrenate, whatever). .V Pilgrim, Peter wrote: -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 09:14 To: Struts Users Mailing List Subject: RE: some best practices questions At 12:36 AM 7/8/2004, you wrote: For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. my 2c The thing is, though, Andrew, these are recurrent issues and seem to require a generic solution. Having a small manager in application scope which can create and monitor a scope which is not application, not session, and not request, is worth the while for these recurrent problems, I think. The persistence of such a scope can be made a function of the data rather than the interest of the clients. That is worth having to use on a general basis, I think, and can be done with a very small performance hit. In fact, my guess is that it would be a performance plus. Michael Well this is astounding, because I looking at JCache JSR whatever? and looking at alternatives like OSCache for a caching the look up of login user accounts. So where the hell is JCache or the standard. If it was there, I think it would give you what you want? -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44 (0)207 883 4447 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: nested tags and bean population
Hey Rick I got rid of the name and type and it worked. Kinda weird. Thanks for the quick reply!!! Later... Rick Reumann [EMAIL PROTECTED] wrote: Juan Alvarado wrote: In my form bean I have an array list called categories that contains objects of type Category. Each Category object contains an array list of Steps. So in my jsp I am rendering this relation as follows: property='categories' id='cat' type='com.securance.vo.ApStepCategoryVO' property='category'/ property='steps' id='step' type='com.securance.vo.ApStepVO' First I iterate through the Category array list and then for each Category I iterate through the steps array list in each category. This renders just fine. The problem is that when a user edits each step and submits the form, only the stesp for the first Category get updated. The rest remain unchanged. I need for the user to be able to edit everything and then submit the form and have the edits be reflected in this nested relationship. Hey Juan. What does the source code look like? I think the source code will reveal a lot. Are you sure your collections aren't getting pulled from some other scope other than the form bean? Also I never use name or the type in my nested:iterate loops. I think that could be the problem. If you use name it will look for that 'name' of the collection in scope. You want to make sure you are using the collection that is nested inside of the other one. If you remove name and type and it still doesn't work that will reveal a lot of the problem. For example if you have a Collection of categories (of ApStepCategoryVO) in you form bean you should be able to do -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - Do you Yahoo!? New and Improved Yahoo! Mail - Send 10MB messages!
RE: application configuration
-Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 12:26 To: Struts Users Mailing List Subject: RE: application configuration I tend to put such things in XML files rather than properties files nowadays. When the app starts up I have a plugin read the files and create configuration objects (using Digester), and put these objects into the servlet context (application scope) where my code can get at them easily. Agreed +1 Basically this is the same I am persuaded to. I written some Digester stuff in the past for simple and complex XML configuration I have a simple property file for a service layer. org.foobar.somelayer.MyPOJI = org.foobar.somelayer.impl.MyPOJOImpl MyPOJI is a service Java interface. MyPOJOImpl is a concreate java class that implements the service MyPOJI I can easily turn this into a XML file or allow a light weight framework to load. Such a simple service layer could load up the service implementations and stick in the application scope where Struts action (or Expresso Controllers) can get them. I have come around to the thinking that Business Delegate and Service Locator can be overfluous ( I have been reading Rod Johnson's new book also). The problem is that I want my services to be lazy loaded. If there a complex service that pulls in XYZ number of Java class, very resource intensive, or is generally particular heavy, then I dont want all of my service to spring into life. Is there any IoC frameworks out there that do lazy loading? Or has anyone on the knowledgeable Struts user done something like this? Tia ==== -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44 (0)207 883 4447 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Multipart forms
You can't get them in the reset() method. Parameters in multipart requests are processed later and made available by wrapping the original request in MultipartRequestWrapper and storing the normal request parameters in that wrapper. Thats not done until the form is populated. The first chance you get to do anything is in the form's validate method. Niall - Original Message - From: Diego [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 19, 2004 3:26 PM Subject: Fwd: Multipart forms Hi! I have a problem when I want to get some parameters in the reset() method of an ActionForm. If the form is a normal form, then I simply call request.getParameter(myparameter) and the parameter is retrieved with no problem. But if the form is of type multipart, then I always get null. The parameter table seems to be filled later, on the RequestProcessor. I need to get parameters in the reset() method, specifically the page parameter, to deal with checkboxes in my wizard-style multipage form. How can I do it in the simplest way possible? Thanks in advance. This message was sent using IMP, the Internet Messaging Program. - 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[2]: some best practices questions ( Neal Ford about caching )
Hi, Enhancing Web Application Performance with caching by Neal Ford. http://www.theserverside.com/articles/content/Caching/article.html -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 09:14 To: Struts Users Mailing List Subject: RE: some best practices questions At 12:36 AM 7/8/2004, you wrote: For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. my 2c The thing is, though, Andrew, these are recurrent issues and seem to require a generic solution. Having a small manager in application scope which can create and monitor a scope which is not application, not session, and not request, is worth the while for these recurrent problems, I think. The persistence of such a scope can be made a function of the data rather than the interest of the clients. That is worth having to use on a general basis, I think, and can be done with a very small performance hit. In fact, my guess is that it would be a performance plus. Michael PP Well this is astounding, because I looking at JCache JSR whatever? PP and looking at alternatives like OSCache for a caching the look up PP of login user accounts. So where the hell is JCache or the standard. PP If it was there, I think it would give you what you want? PP -- PP Peter Pilgrim PP Operations/IT - Credit Suisse First Boston, PP 10 South Colonnade, London E14 4QJ, United Kingdom PP Tel: +44 (0)207 883 4447 PP == PP This message is for the sole use of the intended recipient. If you received PP this message in error please delete it and notify us. If this message was PP misdirected, CSFB does not waive any confidentiality or privilege. CSFB PP retains and monitors electronic communications sent through its network. PP Instructions transmitted over this system are not binding on CSFB until they PP are confirmed by us. Message transmission is not guaranteed to be secure. PP == PP - PP To unsubscribe, e-mail: [EMAIL PROTECTED] PP For additional commands, e-mail: [EMAIL PROTECTED] -- Best regards, Andreymailto:[EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
how to check a 'set' variable in Struts tag/JSTL
hi, how to check a 'set' variable using JSTL or Struts tags ? for example, I have a variable called 'Roles' which is a Set. In a JSP, I want to check if 'Admin'/'Guest'/'User' is in the Set. How do I do this ? Could not find a suitable tag to handle this. thanks li xin __ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Using nested:errors within other nested tags
Hi all, would someone be able to tell me the correct way to do this, taking advantage of the nesting? I expected that after adding errors with the same nested property names as the nested tags use (eg, person[0].username), it might be something like: nested:form ... ... nested:nest property=person[0] tdUser name:/td tdnested:text property=username / nested:errors property=username //td /nested:nest ... /nested:form and the nested property for the errors tag would use the same nesting as the other nested tags (ie, person[0] in this case), but not so, at least in my version of Struts, circa 1.1. I have it working like this now, with a few changes to NestedPropertyHelper (see below), but I can't help thinking I've missed the point. Thanks in advance, Maurice = Changes to two methods (complete file below): public static void setNestedProperties(HttpServletRequest request, NestedPropertySupport tag) { boolean adjustProperty = true; /* if the tag implements NestedNameSupport, set the name for the tag also */ if (tag instanceof NestedNameSupport) { NestedNameSupport nameTag = (NestedNameSupport)tag; if (nameTag.getName() == null || Constants.BEAN_KEY.equals(nameTag.getName()) || Globals.ERROR_KEY.equals(nameTag.getName())) { // ADDED THIS LINE TO SO THAT THE CURRENT NESTING IS PREPENDED TO THE PROPERTY nameTag.setName(getCurrentName(request, (NestedNameSupport) tag)); } else { adjustProperty = false; } } /* get and set the relative property, adjust if required */ String property = tag.getProperty(); if (adjustProperty) { property = getAdjustedProperty(request, property); } tag.setProperty(property); } public static final String getCurrentName(HttpServletRequest request, NestedNameSupport nested) { // Error Tag? if (nested instanceof NestedErrorsTag) { // ADDED THESE LINES SO THE *ERRORS* BEAN IS USED, RATHER THAN THE BEAN USED BY OTHER NESTED TAGS return Globals.ERROR_KEY; } // Rest as before } = Complete file: /* * $Header: /home/cvs/jakarta-struts/src/share/org/apache/struts/taglib/nested/NestedPro pertyHelper.java,v 1.14 2003/04/22 02:28:52 dgraham Exp $ * $Revision: 1.14 $ * $Date: 2003/04/22 02:28:52 $ * * * The Apache Software License, Version 1.1 * * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright *notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in *the documentation and/or other materials provided with the *distribution. * * 3. The end-user documentation included with the redistribution, if *any, must include the following acknowlegement: * This product includes software developed by the *Apache Software Foundation ( http://www.apache.org/ http://www.apache.org/ ). *Alternately, this acknowlegement may appear in the software itself, *if and wherever such third-party acknowlegements normally appear. * * 4. The names The Jakarta Project, Struts, and Apache Software *Foundation must not be used to endorse or promote products derived *from this software without prior written permission. For written *permission, please contact [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] . * * 5. Products derived from this software may not be called Apache *nor may Apache appear in their names without prior written *permission of the Apache Group. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * * This software consists of voluntary contributions made by many * individuals on behalf of
Re: [OT] JBoss, Jaas and Struts
The helpfulness of people on this list continues to amaze me. Glad to know I'm not the only one struggling with this! I will play with the technique described when I get a chance, and I will let everyone know how it goes. But that may be next weekend. Meanwhile, I will post this general solicitation for advice to the list: I have a couple different Servlet-based apps that will be deployed on JBoss and/or Tomcat. Both will be exposed to the Internet, and both will require SSL -- at least server authentication and encryption of credentials (for sure), if not encryption of all content (maybe) and even SSL client authentication (probably not). On one, I will get full access to the Server box (we are planning to use JBoss 3.2.4). But, unfortunately, they are going to have Windows running on the box (ack). Had it been a unix box, my plan would have been to put an Apache in front of the JBoss server and to try to configure all the SSL stuff via Apache, because I know that is commonly done and I know it would be easy to get help doing it. But, if that doesn't work out, is IIS-Tomcat or IIS-JBoss/Tomcat a viable option, securitywise? Or how about JBoss/Tomcat alone? For the other, we will probably use a hosting company such as webappcabaret. They run Tomcat and promise full SSL support. The main question I have is, are there best practices I can follow within the scope of my Struts/Servlet-related programming that will make it easier to upgrade the security of these apps, or does it really matter that much exactly how access to resources is controlled (within this scope I mean)? Typically I find myself in the same environment -- authentication/authorization data is stored via RDBMS, an app-specific login is programmed for authentication, and the Servlet-related processors check User.Permissions objects stored as HttpSession attributes for authorization. Thanks again, Erik Rick Reumann wrote: Erik Weber wrote: Dang I thought I was onto something! I guess I'll stick to my User object in each session, and just try to make sure I centralize the auth checks as much as I can. Dunno why I ever wanted to change it, anyway. Thanks Craig for your time. I also sent your question on to a co-worker and he had this to say... Craig if you have any comments regarding below I'd be interested in forwarding on to my co-worker here as well. Thanks. == This very topic has given me plenty of headaches. Only by diving into the Tomcat code did I start to figure out what was going on. The issue is that the login must happen in two places since both JBoss and Tomcat security were designed to work standalone. JBoss accomplished the integration of the two by hacking Tomcat to use JBossSX as a security realm while allowing Tomcat to continue collecting its own login credentials. When you performed your JAAS login within your action, you only authenticated yourself with JBoss. Since doing so bypassed the aformentioned hack, Tomcat never authenticated and the user principal was never applied to the session. I had a very similar issue not too long ago and when I finally figured out how JBoss/Tomcat integrated, my brain started spinning trying to figure out how to do a more intelligent form login through the JBoss/Tomcat stack. Fortunately form authentication wasn't a requirement for the immediate problem so I didn't put too many cycles on that problem. The moral of the story is that you can't bypass j_security_check without cutting Tomcat out of the authentication loop. You can't proxy j_security_check either. I tried some VERY creative hacks that way and none of them worked. Tomcat was designed specifically to not allow it. Too many potential exploits there. There is a possible solution if you're willing to apply a little elbow grease and bend the JAAS spec a little. Download the Tomcat source and take a look at org.apache.catalina.authenticator.BasicAuthenticator. That's a good reference for how Tomcat authentication works. Now take a look at the FormAuthenticator in the same package. This one is a bit more complex in that it saves the initial request so that it can replay it once authentication is complete. It is conceivable that you can write a StrutsFormAuthenticator that forwards to the ActionServlet to collect the credentials. Once you have your new authenticator, you can register it by adding it to org/apache/catalina/startup/Authenticators.properties with a key like STRUTS. Now go back to your web.xml and replace FORM with STRUTS and next time Tomcat deploys your war it should load up with your custom authenticator. Be aware that JBossWeb has its own shadows of Tomcat authenticators (the aformentioned hacks). Instead of extending Tomcat classes directly, you must extend these and you must patch the org/jboss/web/tomcat/tc4/Authenticators.properties file in deploy/jbossweb-tomcat41.sar/tomcat41-service.jar with your STRUTS reference. Good
Datasource problem again..
Hi ! I have try the follow to retrieve a datasource from Struts using JNDI: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/kiss_web_news); but it doesn't work it is my struts-config,xml: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver / set-property property=url value=jdbc:mysql://localhost/kiss_web_news / set-property property=username value=root / set-property property=password value=1234567 / /data-source /data-sources Do I need to modify the web.xml under $Tomcat/conf ?? It seems that Stucts doesn't registry the datasource to JNDI and I always get a null pointer of datasource. any help? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Datasource problem again..
-Original Message- From: Koon Yue Lam [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 12:46 PM To: Struts Users Mailing List Subject: Datasource problem again.. Do I need to modify the web.xml under $Tomcat/conf ?? You have to add a Resource element in your context in server.xml. Here's the sort of thing that works for us: Context path=/TDX docBase=TDX debug=0 reloadable=true crossContext=true Resource name=jdbc/tdxDB auth=Container type=javax.sql.DataSource / ResourceParams name=jdbc/tdxDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter parameter nameserverName/name valuelocalhost/value /parameter parameter nameusername/name valueTheUserName/value /parameter parameter namepassword/name valueThePassword/value /parameter parameter namedriverClassName/name valuecom.sybase.jdbc2.jdbc.SybDriver/value /parameter parameter nameurl/name valuejdbc:sybase:Tds:MyServername:portname?servicename=MyServiceName/value /parameter parameter namevalidationQuery/name valueselect count(*) from a tablename where something/value /parameter parameter namemaxActive/name value1/value /parameter parameter namemaxIdle/name value1/value /parameter parameter nameremoveAbandoned/name valuetrue/value /parameter parameter nameremoveAbandonedTimeout/name value60/value /parameter /ResourceParams /Context Regards Let me know if you need additional info and I can send you a link where I read up on these details: in a rush now for a meeting..(:( Geeta - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF vs Struts - Development Process Questions
I have some questions regarding the development process when using JSF, especially in realtion to HTML designers. Will everyone on the team need the same advanced design tools? Will the designers who are used to tweaking HTML/JSP be restricted to a completely visual drag and drop environment? Or even worse, will the HTML designers be required to learn JSF mark up code? There was another thread a few weeks ago relating to the general development process. Like many others, we have gotten used to the process where the HTML designers mock up a page and then a software engineer transition the page to a JSP and wires it into our system (using Struts, and JSTL). What is the vision for the development process in JSF? Also, what is the ultimate vision for JSF? Do you invision a IDE that can create interfaces on the same level as Flash? A question asked earlier in this thread: Will JSF integrate with Flash forms? It would be cool to have one integrated development system that could do it all. This thread was started with the question, If you were starting a project today, what would you use, Struts or JSF? My answer is, I would use Struts with JSTL and I would purchase the new Eclipse based IDE, NitroX (http://www.m7.com/). We purchased licenses for NitroX after our CTO came back from JavaOne. It looks like the creative people at M7 have done a lot of things right; they even have planned support for JSF. NitroX may very well evolve into the IDE that can do it all. The best thing about NitroX is that it will enable a transition from Struts to JSF if you decide to go that route. The main reason I would choose Struts/JSTL over JSF is that it works well within the existing skill sets of most developers and designers. I would keep an open mind regarding JSF, especially in regard to high level components that are not easily created using JSP/JSTL. This is the area where JSF could win the game. In the near term, my guess is that the really cool advanced interfaces are going to require Flash. If you'd like to see some leading edge Flash, turn up your sound and go to http://www.2advanced.com/ Mike --- Michael McGrady [EMAIL PROTECTED] wrote: At 01:01 AM 7/19/2004, you wrote: The custom tags that Struts provides (in the html and logic and bean tag libraries) were a necessary precursor to out of the box usage of Struts, in order to make it possible to adopt the basic MVC architectural pattenrs. However, that was *always* a secondary feature in the original vision -- the important part was separation of the view tier logic from the business tier logic. Craig McClanahan (Original creator of the Struts framework) As an original historical matter, it would be hubris of the highest variety to question you on this, Craig. As a historical consequence, however, I for one think that this turned out to be the more revolutionary result of struts, leading coding into taglibs in a way not seen before. The controller and MVC (of sorts) pattern in Struts existed in all sorts of forms prior to Struts. Struts did it better than most, maybe better than all the rest, and provided a standard that people could code to. But, those tags were just a big surprise in the way they hit the market. I, for one, now code tags as readily as I code classes. Not as many, of course, but they are a definite weapon in my quiver. A big reason for that is that I could code using Struts taglib code as a learning and doing mechanism together. Blah, blah, blah. This is not meant to be particularly profound. But I did want to give this boost to the tags in Struts. I think they have been very important to Java. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] JBoss, Jaas and Struts
Hi Erik, Not too long ago I struggled with this issue too and also played with the SecurityFilter (on sourceforge.net) but it didn't work with JBoss. And so after digging and digging I came up with my own security filter that Does work with JBoss and in fact can be adapted to more Application server. Though it is not as fancy in terms of configuration, it is sure working for me and since then I have no headaches - at least not from that direction :) If you are interested in the code, send me an email. Regards, Erez -Original Message- From: Erik Weber [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 6:43 PM To: Struts Users Mailing List Subject: Re: [OT] JBoss, Jaas and Struts The helpfulness of people on this list continues to amaze me. Glad to know I'm not the only one struggling with this! I will play with the technique described when I get a chance, and I will let everyone know how it goes. But that may be next weekend. Meanwhile, I will post this general solicitation for advice to the list: I have a couple different Servlet-based apps that will be deployed on JBoss and/or Tomcat. Both will be exposed to the Internet, and both will require SSL -- at least server authentication and encryption of credentials (for sure), if not encryption of all content (maybe) and even SSL client authentication (probably not). On one, I will get full access to the Server box (we are planning to use JBoss 3.2.4). But, unfortunately, they are going to have Windows running on the box (ack). Had it been a unix box, my plan would have been to put an Apache in front of the JBoss server and to try to configure all the SSL stuff via Apache, because I know that is commonly done and I know it would be easy to get help doing it. But, if that doesn't work out, is IIS-Tomcat or IIS-JBoss/Tomcat a viable option, securitywise? Or how about JBoss/Tomcat alone? For the other, we will probably use a hosting company such as webappcabaret. They run Tomcat and promise full SSL support. The main question I have is, are there best practices I can follow within the scope of my Struts/Servlet-related programming that will make it easier to upgrade the security of these apps, or does it really matter that much exactly how access to resources is controlled (within this scope I mean)? Typically I find myself in the same environment -- authentication/authorization data is stored via RDBMS, an app-specific login is programmed for authentication, and the Servlet-related processors check User.Permissions objects stored as HttpSession attributes for authorization. Thanks again, Erik Rick Reumann wrote: Erik Weber wrote: Dang I thought I was onto something! I guess I'll stick to my User object in each session, and just try to make sure I centralize the auth checks as much as I can. Dunno why I ever wanted to change it, anyway. Thanks Craig for your time. I also sent your question on to a co-worker and he had this to say... Craig if you have any comments regarding below I'd be interested in forwarding on to my co-worker here as well. Thanks. == This very topic has given me plenty of headaches. Only by diving into the Tomcat code did I start to figure out what was going on. The issue is that the login must happen in two places since both JBoss and Tomcat security were designed to work standalone. JBoss accomplished the integration of the two by hacking Tomcat to use JBossSX as a security realm while allowing Tomcat to continue collecting its own login credentials. When you performed your JAAS login within your action, you only authenticated yourself with JBoss. Since doing so bypassed the aformentioned hack, Tomcat never authenticated and the user principal was never applied to the session. I had a very similar issue not too long ago and when I finally figured out how JBoss/Tomcat integrated, my brain started spinning trying to figure out how to do a more intelligent form login through the JBoss/Tomcat stack. Fortunately form authentication wasn't a requirement for the immediate problem so I didn't put too many cycles on that problem. The moral of the story is that you can't bypass j_security_check without cutting Tomcat out of the authentication loop. You can't proxy j_security_check either. I tried some VERY creative hacks that way and none of them worked. Tomcat was designed specifically to not allow it. Too many potential exploits there. There is a possible solution if you're willing to apply a little elbow grease and bend the JAAS spec a little. Download the Tomcat source and take a look at org.apache.catalina.authenticator.BasicAuthenticator. That's a good reference for how Tomcat authentication works. Now take a look at the FormAuthenticator in the same package. This one is a bit more complex in that it saves the initial request so that it can replay it once authentication is
RE: Datasource problem again..
P.S. here you go: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-resources-howto.html Enjoy! :) Geeta -Original Message- From: Koon Yue Lam [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 12:46 PM To: Struts Users Mailing List Subject: Datasource problem again.. Hi ! I have try the follow to retrieve a datasource from Struts using JNDI: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/kiss_web_news); but it doesn't work it is my struts-config,xml: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver / set-property property=url value=jdbc:mysql://localhost/kiss_web_news / set-property property=username value=root / set-property property=password value=1234567 / /data-source /data-sources Do I need to modify the web.xml under $Tomcat/conf ?? It seems that Stucts doesn't registry the datasource to JNDI and I always get a null pointer of datasource. any help? Regards - 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: JSF vs Struts
On Mon, 19 Jul 2004 10:25:13 -0400, Rick Reumann [EMAIL PROTECTED] wrote: We're thinking about using Flash forms for some things. Will they plugin nicely to JSF? Hooking up the output side of that should be a piece of cake ... write some components that render the necessary markup to embed the Flash stuff in the generated page. I'm not familiar with the input side of using Flash for this, but in principle it should still just be a matter of having your component (or renderer) decode() method parse the appropriate request parameters and store the values, just as the standard HTML components do. Craig - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Datasource problem again..
I tried using the datasources tags in struts-config.xml, couldnt get it work so I modified the server.xml in tomcat/conf directly. Just add a context element as follows in your server.xml This is my configuration: Context path=/wrap docBase=C:\tomcat5\webapps\wrap reloadable=true Resource name=jdbc/WrapDB auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/WrapDB parameter namefactory/name valueorg.apache.commons.dbcp.BasicDataSourceFactory/value /parameter !-- Maximum number of dB connections in pool. Make sure you configure your mysqld max_connections large enough to handle all of your db connections. Set to 0 for no limit. -- parameter namemaxActive/name value200/value /parameter !-- Maximum number of idle dB connections to retain in pool. Set to 0 for no limit. -- parameter namemaxIdle/name value10/value /parameter !-- Maximum time to wait for a dB connection to become available in ms, in this example 10 seconds. An Exception is thrown if this timeout is exceeded. Set to -1 to wait indefinitely. -- parameter namemaxWait/name value20/value /parameter !-- dB username and password for dB connections -- parameter nameusername/name value(*place your username here) /value /parameter parameter namepassword/name value(*place your password here)/value /parameter !-- Class name for oracle JDBC driver -- parameter namedriverClassName/name valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value /parameter parameter nameurl/name valuejdbc:microsoft:sqlserver://(***place your URL here)/value /parameter /ResourceParams /Context Hope this helps. -Asif - Original Message - From: Koon Yue Lam [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, July 19, 2004 12:46 PM Subject: Datasource problem again.. Hi ! I have try the follow to retrieve a datasource from Struts using JNDI: Context initCtx = new InitialContext(); Context envCtx = (Context) initCtx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/kiss_web_news); but it doesn't work it is my struts-config,xml: data-sources data-source type=org.apache.commons.dbcp.BasicDataSource set-property property=driverClassName value=org.gjt.mm.mysql.Driver / set-property property=url value=jdbc:mysql://localhost/kiss_web_news / set-property property=username value=root / set-property property=password value=1234567 / /data-source /data-sources Do I need to modify the web.xml under $Tomcat/conf ?? It seems that Stucts doesn't registry the datasource to JNDI and I always get a null pointer of datasource. any help? Regards - 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: some best practices questions
What do you think of caching static or semi-static data that applies to all users (options in a drop down list, etc.) in the application scope? --- Vic Cekvenich [EMAIL PROTECTED] wrote: My comment would be that *data* caching should be done in the data layer (like ibatis, hibrenate, whatever). .V Pilgrim, Peter wrote: -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 09:14 To: Struts Users Mailing List Subject: RE: some best practices questions At 12:36 AM 7/8/2004, you wrote: For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. my 2c The thing is, though, Andrew, these are recurrent issues and seem to require a generic solution. Having a small manager in application scope which can create and monitor a scope which is not application, not session, and not request, is worth the while for these recurrent problems, I think. The persistence of such a scope can be made a function of the data rather than the interest of the clients. That is worth having to use on a general basis, I think, and can be done with a very small performance hit. In fact, my guess is that it would be a performance plus. Michael Well this is astounding, because I looking at JCache JSR whatever? and looking at alternatives like OSCache for a caching the look up of login user accounts. So where the hell is JCache or the standard. If it was there, I think it would give you what you want? -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44 (0)207 883 4447 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: some best practices questions
-Original Message- From: Mike Duffy [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 10:45 AM To: Struts Users Mailing List Subject: Re: some best practices questions What do you think of caching static or semi-static data that applies to all users (options in a drop down list, etc.) in the application scope? I think it depends on how much memory all your ddl and other type stuff is. That's what application scope is for, anythinng that should be application wide. --- Vic Cekvenich [EMAIL PROTECTED] wrote: My comment would be that *data* caching should be done in the data layer (like ibatis, hibrenate, whatever). .V Pilgrim, Peter wrote: -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: 08 July 2004 09:14 To: Struts Users Mailing List Subject: RE: some best practices questions At 12:36 AM 7/8/2004, you wrote: For this particular use case I would either just use the session, or alternatively I would just look up the dropdowns from db each time and accept the performance hit, but its (probably) not worth the development time - including ongoing maintenance - to do anything overly tricky just for a few dropdowns. my 2c The thing is, though, Andrew, these are recurrent issues and seem to require a generic solution. Having a small manager in application scope which can create and monitor a scope which is not application, not session, and not request, is worth the while for these recurrent problems, I think. The persistence of such a scope can be made a function of the data rather than the interest of the clients. That is worth having to use on a general basis, I think, and can be done with a very small performance hit. In fact, my guess is that it would be a performance plus. Michael Well this is astounding, because I looking at JCache JSR whatever? and looking at alternatives like OSCache for a caching the look up of login user accounts. So where the hell is JCache or the standard. If it was there, I think it would give you what you want? -- Peter Pilgrim Operations/IT - Credit Suisse First Boston, 10 South Colonnade, London E14 4QJ, United Kingdom Tel: +44 (0)207 883 4447 == This message is for the sole use of the intended recipient. If you received this message in error please delete it and notify us. If this message was misdirected, CSFB does not waive any confidentiality or privilege. CSFB retains and monitors electronic communications sent through its network. Instructions transmitted over this system are not binding on CSFB until they are confirmed by us. Message transmission is not guaranteed to be secure. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? New and Improved Yahoo! Mail - 100MB free storage! http://promotions.yahoo.com/new_mail - 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: JSF vs Struts - Development Process Questions
If you'd like to see some leading edge Flash, turn up your sound and go to http://www.2advanced.com/ That's some pretty cool stuff! robert -Original Message- From: Mike Duffy [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 12:58 PM To: Struts Users Mailing List Subject: Re: JSF vs Struts - Development Process Questions I have some questions regarding the development process when using JSF, especially in realtion to HTML designers. Will everyone on the team need the same advanced design tools? Will the designers who are used to tweaking HTML/JSP be restricted to a completely visual drag and drop environment? Or even worse, will the HTML designers be required to learn JSF mark up code? There was another thread a few weeks ago relating to the general development process. Like many others, we have gotten used to the process where the HTML designers mock up a page and then a software engineer transition the page to a JSP and wires it into our system (using Struts, and JSTL). What is the vision for the development process in JSF? Also, what is the ultimate vision for JSF? Do you invision a IDE that can create interfaces on the same level as Flash? A question asked earlier in this thread: Will JSF integrate with Flash forms? It would be cool to have one integrated development system that could do it all. This thread was started with the question, If you were starting a project today, what would you use, Struts or JSF? My answer is, I would use Struts with JSTL and I would purchase the new Eclipse based IDE, NitroX (http://www.m7.com/). We purchased licenses for NitroX after our CTO came back from JavaOne. It looks like the creative people at M7 have done a lot of things right; they even have planned support for JSF. NitroX may very well evolve into the IDE that can do it all. The best thing about NitroX is that it will enable a transition from Struts to JSF if you decide to go that route. The main reason I would choose Struts/JSTL over JSF is that it works well within the existing skill sets of most developers and designers. I would keep an open mind regarding JSF, especially in regard to high level components that are not easily created using JSP/JSTL. This is the area where JSF could win the game. In the near term, my guess is that the really cool advanced interfaces are going to require Flash. If you'd like to see some leading edge Flash, turn up your sound and go to http://www.2advanced.com/ Mike --- Michael McGrady [EMAIL PROTECTED] wrote: At 01:01 AM 7/19/2004, you wrote: The custom tags that Struts provides (in the html and logic and bean tag libraries) were a necessary precursor to out of the box usage of Struts, in order to make it possible to adopt the basic MVC architectural pattenrs. However, that was *always* a secondary feature in the original vision -- the important part was separation of the view tier logic from the business tier logic. Craig McClanahan (Original creator of the Struts framework) As an original historical matter, it would be hubris of the highest variety to question you on this, Craig. As a historical consequence, however, I for one think that this turned out to be the more revolutionary result of struts, leading coding into taglibs in a way not seen before. The controller and MVC (of sorts) pattern in Struts existed in all sorts of forms prior to Struts. Struts did it better than most, maybe better than all the rest, and provided a standard that people could code to. But, those tags were just a big surprise in the way they hit the market. I, for one, now code tags as readily as I code classes. Not as many, of course, but they are a definite weapon in my quiver. A big reason for that is that I could code using Struts taglib code as a learning and doing mechanism together. Blah, blah, blah. This is not meant to be particularly profound. But I did want to give this boost to the tags in Struts. I think they have been very important to Java. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Vote for the stars of Yahoo!'s next ad campaign! http://advision.webevents.yahoo.com/yahoo/votelifeengine/ - 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: JSF vs Struts - Development Process Questions
At 10:51 AM 7/19/2004, you wrote: If you'd like to see some leading edge Flash, turn up your sound and go to http://www.2advanced.com/ HELLO! Wow! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: JSF vs Struts - Development Process Questions
JSF with spring and hibernate tutorial. http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html http://www.javaworld.com/javaworld/jw-07-2004/jw-0719-jsf.html Guess I should read it before I comment again. --b Bryan Hunt wrote: +1 I am sceptical about this technology but potentially it could be good. I'm going to look at JSF in 6 months or a years time when it is clearer if this is going to be another timewaster/project wrecker or something usefull and useable. In the meantime I recomend NitroX as well although I don't like the companys patent pending bs about their app x ray technology Things like that don't make me particularly enthusiastic as someone who has to constantly worry about software patents when I'm writing a LGPL app/using a linux server. --b Mike Duffy wrote: I have some questions regarding the development process when using JSF, especially in realtion to HTML designers. Will everyone on the team need the same advanced design tools? Will the designers who are used to tweaking HTML/JSP be restricted to a completely visual drag and drop environment? Or even worse, will the HTML designers be required to learn JSF mark up code? There was another thread a few weeks ago relating to the general development process. Like many others, we have gotten used to the process where the HTML designers mock up a page and then a software engineer transition the page to a JSP and wires it into our system (using Struts, and JSTL). What is the vision for the development process in JSF? Also, what is the ultimate vision for JSF? Do you invision a IDE that can create interfaces on - 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: how to check a 'set' variable in Struts tag/JSTL
lixin chu wrote: for example, I have a variable called 'Roles' which is a Set. In a JSP, I want to check if 'Admin'/'Guest'/'User' is in the Set. How do I do this ? Could not find a suitable tag to handle this. Unfortunately I haven't found a tag in JSTL or Struts that does this (I think there should be one in JSTL though - also a contains for Lists). My guess is there is probably a gneric one out there that someone created. If not, time to make one and share:) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
http 405 error
Would anyone have any ideas why I would be receiving a 405 error (page cannot be displayed address is incorrect) when my struts application tries to initiate a .do action servlet call? I have checked the web.xml file and ensured the servlet mapping for all *.do paths are correct. If I tried to access a page directly (jsp) that uses the struts-html.tld tag library, I get errors informing me that the tag definitions cannot be found. I have also verified that the .tld is present. Any help would be greatly appreciated, Sandy Bingham-Porter Ecommerce Development Eastern Illinois University - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: JSF vs Struts
Yeahbut have you seen how much Flex costs? cheers, David |-+-- | | Hookom, Jacob| | | [EMAIL PROTECTED]| | | ckhboc.com| | | | | | 07/19/2004 02:42 PM| | | Please respond to | | | Struts Users Mailing | | | List | | | | |-+-- ---| | | | To: 'Struts Users Mailing List' [EMAIL PROTECTED] | | cc: | | Subject: RE: JSF vs Struts | ---| I've been toying around with integrating JSF and Macromedia Flex. Both use xml markup in which you can generate a multistep rendering process involving JSTL/JSF and MXML: http://www.macromedia.com/devnet/flex/articles/first_flexapp_02.html So JSTL/JSF could communicate the view layer via a special FlexRenderKit of the same components you already use within HTML applications in JSF. Input processing would probably best be communicated through SOAP from the client to the server once the UI is defined via the FlexRenderKit. Regards, Jacob Hookom -Original Message- From: Craig McClanahan [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 12:13 PM To: Struts Users Mailing List Subject: Re: JSF vs Struts On Mon, 19 Jul 2004 10:25:13 -0400, Rick Reumann [EMAIL PROTECTED] wrote: We're thinking about using Flash forms for some things. Will they plugin nicely to JSF? Hooking up the output side of that should be a piece of cake ... write some components that render the necessary markup to embed the Flash stuff in the generated page. I'm not familiar with the input side of using Flash for this, but in principle it should still just be a matter of having your component (or renderer) decode() method parse the appropriate request parameters and store the values, just as the standard HTML components do. Craig - 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]
[OT] RTF PDF export options
Any suggestions for converting html to RTF and PDF inside an action class and then sending the RTF or PDF back to the client? Open source tools, code snippets, tips tricks, etc. ?? Thanks a bunch. Brian Barnett
Re: [OT] RTF PDF export options
From: Barnett, Brian W. [EMAIL PROTECTED] Any suggestions for converting html to RTF and PDF inside an action class and then sending the RTF or PDF back to the client? iText, but I don't do it in an Action, I redirect to a Servlet whose job it is to output the PDF bytes. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] RTF PDF export options
Brian: I'm guessing that you can do this with iText. It has RTF and PDF writers, and I think you can use the RTF as the source doc for the output PDF. FYI, if you're running iText on a headless server, you'll need to set java.awt.headless=true. This works for JDK 1.4.x. Barnett, Brian W. wrote: Any suggestions for converting html to RTF and PDF inside an action class and then sending the RTF or PDF back to the client? Open source tools, code snippets, tips tricks, etc. ?? Thanks a bunch. Brian Barnett -- Nick Heudecker System Mobile, Inc. Email: [EMAIL PROTECTED] Phone: 312.420.8217 Web: http://www.systemmobile.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] RTF PDF export options
It's a recipe in Struts Recipes (Manning -- publishing soon). If you contact George Franciscus through Manning he might give you some advice. Danilo Gurovich Manager, Web Development LowerMyBills.com [EMAIL PROTECTED] 2401 Colorado Ave., 2nd Floor Santa Monica, CA 90404 (310) 998-6412 -Original Message- From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] Sent: Monday, July 19, 2004 3:22 PM To: '[EMAIL PROTECTED]' Subject: [OT] RTF PDF export options Any suggestions for converting html to RTF and PDF inside an action class and then sending the RTF or PDF back to the client? Open source tools, code snippets, tips tricks, etc. ?? Thanks a bunch. Brian Barnett - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: struts response character encoding.
man, 19.07.2004 kl. 14.58 skrev Emmanouil Batsis: There this system property you can set but I can't remember it, it's used as the encoding to use when reading files... Anyway, I always edit my .jsp and .properties using UTF-8, then pass them through the native2ascii ant task during my build. It's just a wrapper for the same-named JDK binary; you can use that directly if you dont use Ant. Works great. Yes, I know. I am using that one for my resource files. But In my opinion, it should not be necessary to convert the encoding for that file(s) either. Somewhere behind the scenes there is a java.util.Properties class used, and that class assumes iso-8859-1. http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html#encoding Encodings should be as transparent as possible, not the assumptions of some developers. Since I am developing and deploying on utf-8 encoding platforms, everything should be smooth, but it is not. I discovered that Struts use iso-8859-1 as default (same as java.util.Properties), and in order to override this setting I have to put a % @page ... % directive on every jsp. Ant can really native2ascii'ify all of this, but what about the one who have to administer this mess? When I am on my way to the next job, and they find a misspelling or they have to change some stuff in either the jsp or a resource file lokking like this (arbitrary Norwegian text): Sp\u00f8rsm\u00e5lsgruppen slettet, tilh\u00f8rende sp\u00f8rms\u00e5l eksisterer fortsatt I wish encodings were as simple as they could be (everyone used utf-8) ;-) -- Olve Sther Hansen [EMAIL PROTECTED] Intermedia/Aksis - Unifob AS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Datasource problem again..
Yes, it helps and I know I can get it done if I set the context element in server.xml, but if I set the datasource in server.xml, do I need to set the datasource in struts-config.xml again?? If I am right, I think if datasource is setup in server.xml, it has the scope of entire Tomcat, that means all webapps can use that datasource. Also it can be retrieved by JNDI. If the datasource is setup in struts-config.xml, the scope becomes struts only and is specific to only one webapp, and it can't be retrieved by JNDI. So I can setup datasource in both ways, setup in server.xml has much more flexibilty and benifit from JNDI, why do I need to setup in struts-config.xml?? once again, thanks, ^^ Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Datasource problem again..
I recall reading about a month ago that setting up of data-sources in struts-config was purely for some backwards-compatability issue, and was no longer advised. I haven't bothered to do it. I set up my data source in a server.xml context, and it works fine. Like you I'd prefer to have server-wide scope on the data-source rather than context scope, but I haven't spent any time on it yet. One option may be to configure the data-source as part of the DefaultContext. I believe all other contexts inherit from a DefaultContext if one is configured - but like I said, I haven't tried it yet. Regards, John [EMAIL PROTECTED] Ph (09) 372-5010 |-+ | | Koon Yue Lam | | | [EMAIL PROTECTED]| | | om | | || | | 20/07/2004 01:54 | | | PM | | | Please respond to| | | Struts Users| | | Mailing List| | || |-+ --| | | | To: Struts Users Mailing List [EMAIL PROTECTED], Asif Rahman [EMAIL PROTECTED] | | cc: | | Subject: Re: Datasource problem again.. | --| Yes, it helps and I know I can get it done if I set the context element in server.xml, but if I set the datasource in server.xml, do I need to set the datasource in struts-config.xml again?? If I am right, I think if datasource is setup in server.xml, it has the scope of entire Tomcat, that means all webapps can use that datasource. Also it can be retrieved by JNDI. If the datasource is setup in struts-config.xml, the scope becomes struts only and is specific to only one webapp, and it can't be retrieved by JNDI. So I can setup datasource in both ways, setup in server.xml has much more flexibilty and benifit from JNDI, why do I need to setup in struts-config.xml?? once again, thanks, ^^ Regards - 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: Datasource problem again..
Thx ! Since I am using Tomct 5 with auto-depoly, my Webapp DOESN'T has a Context element in server.xml. I think I will has a try to setup in default-context, or should I manually all a context element of my Webapp in server.xml?? Regards - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: regular expression
^((?!Test).)* (B (B (B (B-Original Message- (BFrom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] (BSent: Friday, July 16, 2004 2:21 PM (BTo: Struts Users Mailing List (BSubject: regular expression (B (BHi, (B I want to validate an attribute, the rule is that the input should (Bnot start with 'Test', how to write the regular expression for this (Bvalidation. Please help me guys. (B (BThanks and regards (BSubramaniam Olaganthan (BTata Consultancy Services (BMailto: [EMAIL PROTECTED] (BWebsite: http://www.tcs.com (B (B_ $B3Z$7$$3(J8;z$G%3%3%mEA$o$k%a%C%;%s%8%c!<(B http://messenger.msn.co.jp/ (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
RE: regular expression
I am sorry. (BA message was transmitted by mistake. (B (B (B (BFrom: "Hirofumi Akiyama" [EMAIL PROTECTED] (BReply-To: "Struts Users Mailing List" [EMAIL PROTECTED] (BTo: [EMAIL PROTECTED] (BSubject: RE: regular expression (BDate: Tue, 20 Jul 2004 12:10:15 +0900 (B (B^((?!Test).)* (B (B (B (B-Original Message- (BFrom: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: (BFriday, July 16, 2004 2:21 PM (BTo: Struts Users Mailing List (BSubject: regular expression (B (BHi, (B I want to validate an attribute, the rule is that the input (Bshould not start with 'Test', how to write the regular expression (Bfor this validation. Please help me guys. (B (BThanks and regards (BSubramaniam Olaganthan (BTata Consultancy Services (BMailto: [EMAIL PROTECTED] (BWebsite: http://www.tcs.com (B (B_ (B$B3Z$7$$3(J8;z$G%3%3%mEA$o$k%a%C%;%s%8%c!<(B http://messenger.msn.co.jp/ (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED] (B (B (B_ $B3Z$7$$3(J8;z$G%3%3%mEA$o$k%a%C%;%s%8%c!<(B http://messenger.msn.co.jp/ (B (B (B- (BTo unsubscribe, e-mail: [EMAIL PROTECTED] (BFor additional commands, e-mail: [EMAIL PROTECTED]
Re: Datasource problem again..
If you're auto-deploying and can get the DefaultContext to work for you, then that's what I'd do. (I'm not auto-deploying, so my case isn't so straight-forward). You always have the fall-back of configuring Context datasources if you run into trouble. There's an example of configuring a DefaultContext with a datasource here: http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/defaultcontext.html This is how I've configured my data-source: Context docBase=/webapps/isurvey path=/isurvey reloadable=true Resource name=jdbc/as400 auth=Container type=javax.sql.DataSource/ ResourceParams name=jdbc/as400 parameter namemaxWait/name value5000/value /parameter parameter namemaxActive/name value4/value /parameter parameter namepassword/name value**/value /parameter parameter nameurl/name valuejdbc:as400://localhost;naming=system/value /parameter parameter namedriverClassName/name valuecom.ibm.as400.access.AS400JDBCDriver/value /parameter parameter namemaxIdle/name value2/value /parameter parameter nameusername/name value**/value /parameter /ResourceParams /Context And this is how I use the data-source in java: Context ctx = new InitialContext(); Context envCtx = (Context) ctx.lookup(java:comp/env); DataSource ds = (DataSource) envCtx.lookup(jdbc/as400); I'd be interested to know how you get on with this. Regards, John [EMAIL PROTECTED] Ph (09) 372-5010 |-+ | | Koon Yue Lam | | | [EMAIL PROTECTED]| | | om | | || | | 20/07/2004 02:45 | | | PM | | | Please respond to| | | Struts Users| | | Mailing List| | || |-+ --| | | | To: Struts Users Mailing List [EMAIL PROTECTED] | | cc: | | Subject: Re: Datasource problem again.. | --| Thx ! Since I am using Tomct 5 with auto-depoly, my Webapp DOESN'T has a Context element in server.xml. I think I will has a try to setup in default-context, or should I manually all a context element of my Webapp in server.xml?? Regards - 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: Datasource problem again..
You can still have a context regardless of whether you auto deploy or not. See that snippet that jthopmson sent? You can deploy that with your war file, I think the name of the xml has to match the war file name if I'm not mistaken. Then you will have a context properly setup with the datasource. On Tue, 20 Jul 2004 11:24:17 +0800, Koon Yue Lam [EMAIL PROTECTED] wrote: Thx !! I will try it out tonight after work !! and let u know if I sucess or not, ^^ - 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: Datasource problem again..
thanks for the help ! I will give it a try - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Logic Iterate tag
Hi All, I am currently using for loops and iterators for traversing arrays and coolections in JSP. I am planning to use this logic : iterate tag in place of this. I need to know if there is any advantage of using this tag in terms of performance or reduction in Java code in JSP etc. Thanks and Regards Aditya