RE: The design of bread crumb trail
I hope I am interpreting your question properly. If not, sorry. It sounds like you are asking when you return to page 1 from page 2 should you re-populate the page 1 form. The answer is usually yes. Either Struts-1 or Struts-2 tags will help in the re-population. If you want to use plain html tags with refresh, you can use the jsp EL to repopulate, something like **input type="text" name="userName" value="${userName}"** If 'userName' is found in the jsp-accessible scope, the box will be re-populated. Probably you should not re-populate sensitive fields like SSN or password, however. - Ray Clough Thanks for the answers, but I would like a direct answer to my questions (1)... (2)... . Any thoughts? Zhang, Larry (L.) wrote: > Say I have two Jsp pages, Page 1, Page 2. > > On page 1 I have some text fields such as Name, SSN for example, and the > user types in Name and SSN and then submit the form and the navigation > goes to page 2. On page 2 I have the bread crumb trail saying Page 1>> > Page 2. Notice that Page 1 is a clickable link, and when you click on > the link, Page 1 is shown. (Page 2, on the bread crumb trail, is not > clickable since the current page is Page 2) > > My question is: (1) in current J2EE/Struts industry standard, does it > make sense to display the data that the user entered on Page 1 for Name > and SSN when coming from the bread crumb trail on Page 2? (2) what > technique I need to use to see the data that the user typed in for Name > and SSN on Page 1, when coming from the bread crumb trail on Page 2? > > My application is a Struts and J2EE based application. > > Thanks. > -- View this message in context: http://www.nabble.com/How-to-forward-to-an-unknown-view-in-Struts-2--tf3718165.html#a10443961 Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Hiding/encrypting URL parameters in Struts application
Hi Is there a way to hide/encrypt URL parameters using Struts? Right now i am passing some critical params in the URL For e.g http://localhost:8080/method=xyz?param1=123¶m2=xyz I want to avoid this. Please let me know if anything can be done about this. Thanks Sid
How to set attribute of
I read document from struts2 and I know has label,name,cssStyle,cssClass,so I use as follows: I want to set label "Your First Name" as red color and font size is 6,but when I execute above code,I found label "Your First Name" is still black color and not red color and its size is not 6,why? How to define label attribute in to realize above function? My other question is when execute ,it will shows follows: Your First Name:|Mary| I want to know how to set its length,such as label "Your First Name" occupy 30% width of line and "Mary" occupy 70% width of line? Thanks
Re: Custom component - custom tag
http://struts.apache.org/2.x/docs/access-to-valuestack-from-jsps.html to quote "There is a simple, if not elegant, solution available in JSP 2.0 EL, for exposing ValueStack to OGNL. It is possible to create custom functions that can be called from EL expressions. Functions have to be 'public static' and specified in a TLD file. To use a function, import the TLD in a JSP file where you've want to use a function." HTH M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Mansour" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Friday, May 11, 2007 10:04 PM Subject: Custom component - custom tag where do I find tutorial about writing my own UI component ? I wrote a tag already to be used with JSP then when I tried it with struts 2 it didn't work. Basically, because I am passing the object as string and trying to retrieve it form the context in the custom tag. This is not working because struts ( I believe passes it into a valueStack). How do I rewrite my tag. Is there a tutorial ? - 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: Hiding/encrypting URL parameters in Struts application
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sid, Sid wrote: > Is there a way to hide/encrypt URL parameters using Struts? Struts does not handle this directly. You'll have to do it yourself or use an existing tool to protect these parameters. When I do this type of thing, I symmetrically encrypt the data and then pass the encrypted string as a GET parameter. In order to reduce the threat of replay attacks, I encrypt the expiration date and time of the data along with it and refuse to accept it on the other end if it has expired. There's a project out there called HDIV that is supposed to protect data like this. I don't know a thing about it except that someone posts updates to the project on this list occasionally. (http://www.hdiv.org) Hope that helps, - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGRcXF9CaO5/Lv0PARAqRZAJ9uIj6yyZ7Y5+WJIhpwXdPYQ5HXvACgsImg XJMCHxSKee/rTQCJNOIL2L8= =Umki -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Custom component - custom tag
Thank you: This looks close to what I need. But I think I am missing something here. I am setting an abject value in the Action. Where is this object stored, on the ValueStack ? Basically I am setting a resuletSet in the action and I need a tag to display it, so How can I access it from the tag. I tried this: ActionContext a = ActionContext.getContext(); Object value = a.getValueStack().findValue("results"); but it's not working. Martin Gainty wrote: http://struts.apache.org/2.x/docs/access-to-valuestack-from-jsps.html to quote "There is a simple, if not elegant, solution available in JSP 2.0 EL, for exposing ValueStack to OGNL. It is possible to create custom functions that can be called from EL expressions. Functions have to be 'public static' and specified in a TLD file. To use a function, import the TLD in a JSP file where you've want to use a function." HTH M-- This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: "Mansour" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Friday, May 11, 2007 10:04 PM Subject: Custom component - custom tag where do I find tutorial about writing my own UI component ? I wrote a tag already to be used with JSP then when I tried it with struts 2 it didn't work. Basically, because I am passing the object as string and trying to retrieve it form the context in the custom tag. This is not working because struts ( I believe passes it into a valueStack). How do I rewrite my tag. Is there a tutorial ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: moving on to Hibernate with S2...
If you like RoR (and I do) you might like some of the "magic" that Struts 2 and Spring can provide. It isn't quite perfect yet (at least not the Struts 2 part), but I'm pretty happy with it. By "magic" I mean convention based configuration, which cuts down on the number of places you have to enter the same data. With a default Struts 2 + Spring IOC setup, adding a new Action means : 1. Create an Action class 2. Create a view file (JSP in my case) 3. Describe the Action class and view in the struts configuration file (struts.xml) 4. Describe the Action class in the Spring IOC configuration file (applicationContext.xml) 5. "Wire" the dependencies needed by the Action class in the Spring IOC configuration file (applicationContext.xml) This seems like a lot of work, especially compared with RoR. My solution has been to use the following pieces of "Magic": 1. Struts 2 "Zero-Configuration" 2. Spring IOC "autowire by-name" 3. Struts 2 Spring Integration This cuts the above steps down to: 1. Create the Action class. 2. Create the View file 3. Annotate the Action class. 4. Add IOC properties to the action class This only saves 1 step, but it cuts the number of configuration files edited from two to zero. In fact, the only files that need to be edited are your Action and your View, which is just what RoR requires. The downside, is the mess of Annotations that this approach requires on the Action class. There is also a "codebehind" plugin for Struts 2 that I have yet to try out, but might cut down on the required Annotations. The missing piece here is the Model component. Hibernate offers one solution, and by using Annotations instead of mapping files, you can get close to the simplicity of Active Record, though not in terms of setup. My preferred solution, as of late, is to implement a Data Access Layer. This is more complicated, and more work to setup and maintain than Active Record, and certainly requires more typing than Hibernate alone. However, I find that more often than not, the database can prove to be a performance sticking point. By having a clear DAO layer I can tweak resource hogging auto-generated queries without having to touch domain logic, which is what I found myself doing when relying on Hibernate alone. For example, if I have a survey building tool with an administrative front end, and I have an Action defined to assign questions for a new survey, the action might receive a surveyId and a list of questionIds. With Hibernate alone, I would be tempted to write something like the following in my Action class: Survey selectedSurvey = new Survey(surveyId); hibernateSession.load(selectedSurvey); selectedSurvey.setQuestions(null); for (long questionId : questionIds) { Question q = new Question(questionId); hibernateSession.load(q); selectedSurvey.addQuestion(q); } hibernateSession.update(selectedSurvey); Now, that's a terrible example of database usage, but it sure was easy to write, and its rather readable, even with no comments. Now, with a DAO layer defined, I might write something like this in my Action class: surveyDAO.setAssignedQuestions(surveyId, questionIds); In the definition of the surveyDAO, I might use the same code that I previously put in my Action class, and it might never prove to be a problem even with all the excessive database. However, if it did prove to be a problem, I would know exactly where to address it, and I could be assured that my database performance tuning would be restricted to its own layer, and would not make my action any less readable. Josh On 5/11/07, Ray Clough <[EMAIL PROTECTED]> wrote: Personally, I do *NOT* like to use Spring, because every time I touch it everything breaks. I think that a better solution is to use a ServiceLocator to provide the Hibernate SessionFactory. I did this in S1, and it worked very easily, and didn't break anything. ServiceLocator is described in the "Core J2EE Patterns" book very nicely (available on-line at Sun). In my opinion the rush to IOC and DependencyInjection is more of a fad/hype than a real benefit. ServiceLocator is easier, and makes your app more portable, because you don't have to implement the IOC service before you can get your code to work in the new framework. All this, of course, is IMHO, and I know I'm probably a minority here. - Ray Clough Rick Schumeyer wrote: > > Now I'm trying to configure Hibernate with S2, which many others have > done. I was trying to follow the example in WebWork in Action, but > things have obviously changed since then. > > To be clear, the problem is to create a SessionFactory once in such a > way that all my actions can easily have access to it. The approach in > WWiA uses IoC. As far as I know, it would work in S2 but would need > many modifications because package names have changed. And perhaps > other mods would be needed? > > I'm not sure if the best approach is: > > a) Use the strategy in WWiA, but change the import stat
struts layout
Hi Everyone, I want to create a table using struts layout with edit,delete, update option and accessing the data from the database. I am new to struts...I want to learn more in thisPlease help. Rgds Shaki - Office firewalls, cyber cafes, college labs, don't allow you to download CHAT? Here's a solution!
datetimepicker support for time zone and locale?
Does the datetimepicker have support for specifying different locales and timezones? I am presuming that it takes into account the locale specified by the request, but don't see that specifically mentioned anywhere. And I don't see it indicating any support for timezones. -- Allen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Installing strutsIDE plugin for eClispe
Just unzip it into eclipse folder. The zip should contain plugins and/or features directories -after unzipping, contents of these directories will be in eclipse/plugins eclipse/features. Saravanan Vijayappan wrote: > Hello, > > How should i install StrutsIDE plugin for eclipse 3.1.2 ? > > I have downloaded the below zip file > > tk.eclipse.plugin.struts_2.0.4.zip > > Could you tell how should it be installed and where ? > > Thanks & Regards, > Saravanan Vijayappan, > +91 9448833571. > > > > > > Get > the free Yahoo! toolbar and rest assured with the added security of spyware > protection. > http://new.toolbar.yahoo.com/toolbar/features/norton/index.php -- Tomas Kramar - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[S2] Using Struts with Eclipse + M2Eclipse Plugin
Hey Guys, I try to make a Struts project wok with the m2eclipse plugin. When I save my pom.xml I get the following error: 13/05/07 02:17:42 BST: Missing: 1) com.sun:tools:jar:1.5.0 Try downloading the file manually from the project website. Then, install it using the command: mvn install:install-file -DgroupId=com.sun -DartifactId=tools \ -Dversion=1.5.0 -Dpackaging=jar -Dfile=/path/to/file Path to dependency: 1) quickstart:quickstart:war:0.1-SNAPSHOT 2) org.apache.struts:struts2-core:jar:2.0.6 3) com.sun:tools:jar:1.5.0 1 required artifact is missing. for artifact: quickstart:quickstart:war:0.1-SNAPSHOT from the specified remote repositories: central (http://repo1.maven.org/maven2) I already tried to solve this with various proposed solutions, but it never worked for me. Some solutions I tried: http://maven.apache.org/general.html#tools-jar-dependency http://www.mail-archive.com/[EMAIL PROTECTED]/msg00379.html Cheers, Nicolas - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with text encoding..
Hi, I am using Kubuntu edgy OS.. I installed Netbeans yesterday... The installation went smooth and fine... here are the setup I have, 1) JDK - 1.5.0_11 2) Netbeans - netbeans-5.5 3) Tomcat - Bundled with Netbeans... I thought of developing a Struts application in my Language - Tamil... so followed the instructions in http://www.netbeans.org/kb/50/quickstart-webapps-struts.html replaced the text/strings in .jsp pages to my language... also replaced the text/ string in ApplicationResource.properties file to my language... Problem #1: In Netbeans IDE the text display wasn't proper.. both in .jsp and ApplicationResource.properties files.. in .jsp it was squares... and in ApplicationResource.properties i had some junk values... so used Kate text editor to edit the .jsp file and ApplicationResource.properties files... after completing i gave F6 and ran it.. it was successful.. The firefox browser opened... and the action was called.. Problem #2: but the Tamil text that I had given in the .jsp file was properly displayed... The text that i gave in ApplicationResource.properties file wasn't displayed correctly... I have uploaded the screenshot in the link given below The junk values can be identified as those next to "Your Name" in English.. http://flickr.com/photos/[EMAIL PROTECTED]/495583036/ Kindly help me in fixing Problem #1 & #2.. Thank You.. -- ஠னà¯à®ªà¯à®à®©à¯, à®à®®à®¾à®à¯à®à¯. https://wiki.ubuntu.com/sriramadas http://amachu.net à®à¯à®²à¯à®²à®¿à®²à¯ à®à®¯à®°à¯à®µà¯ தமிழà¯à®à¯ à®à¯à®²à¯à®²à¯ - ஠தà¯à®¤à¯ தà¯à®´à¯à®¤à¯ பà®à®¿à®¤à¯à®¤à®¿à®à®à®¿ பாபà¯à®ªà®¾ à®à¯à®²à¯à®µà®®à¯ நிறà¯à®¨à¯à®¤à®¹à®¿à®¨à¯à®¤à¯ ஸà¯à®¤à®¾à®©à®®à¯ - ஠தà¯à®¤à¯ தினமà¯à®®à¯ பà¯à®à®´à¯à®¨à¯à®¤à®¿à®à®à®¿ பாபà¯à®ªà®¾