wood burning stoves 2.0*
The moose likes Struts and the fly likes This weeks giveaway Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "This weeks giveaway" Watch "This weeks giveaway" New topic
Author

This weeks giveaway

Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
This week we are giving away 4 copys of the book "Struts in Action: A Practical Guide to the Leading Java Web Framework".
And the best part... the Author, Ted Husted, will be online to answer your questions
Read Chapter 12 - Validating user input on-line!<br>
<br>
Thanks to the people at [url=http://www.manning.com/>Manning Publishing[/url] for the Books!
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Doesn't using struts shield the developer from underlying details of servlet, tags etc.


Groovy
Ren Li
Ranch Hand

Joined: Feb 20, 2002
Posts: 64
I am currently using Web Development Kit in Documentum, in which Servlet is built-in and a lot of JSPs. Is that possible to add struts in such a structure?
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
Hi Carl,
I would like to thank you. I'm very interested by this book.I'm preparing SCWCD and i directly intend to go to Struts for MVC acchitecture.
I already developped with Struts but not enough knowledge about it and EJB. I want to develop EJB with Struts. How much is important to develop whith Struts ? more security ? and about hacking ?Thank you for understanding.
Roger Gazdzicki
Ranch Hand

Joined: Oct 04, 2002
Posts: 47
Doesn't struts take care of all validation itself. I thought it had built in routines for integer and nulls?


Roger G<br /> <br />Anybody who tries to make anything idiot proof has obviously underestimated the intelligence of an idiot.
Erik Hatcher
Author
Ranch Hand

Joined: Jun 11, 2002
Posts: 111
Here is information about an example application I created demonstrating a nice way to deal with validation in Struts. It uses XDoclet to generate the validation.xml file from tagged form bean setters. Below is from a post where I announced this application to the world. Please only contact me about this application using the e-mail address below, do not reply about it in this forum as I am not a frequent visitor here. I'm tuning in this week to check out the Q&A with Ted Husted!
----------
The application I used in my September TriJUG presentation, and thereafter at several symposiums, another JUG (NOVA JUG) and ApacheCon has now been bundled for mass release.
It is a trimmed down version of the application Steve and I developed for our Java Development with Ant book.
Relevant to Struts folks are these tidbits:
- XDoclet is generating struts-config.xml, validation.xml, web.xml, and antbook.tld
- LabelTag (currently mysteriously busted for required tagging) is included. This tag styles field labels differently if its in error, and (when its not busted, it works on my production app actually) it shows an asterisk by required fields.
- strutsgen: a one-off starter generation for JSP's and ApplicationResources.properties snippets for cutting and pasting into the main application. It uses XDoclet to process a specified form bean and uses the fields it finds for generation.
- Use of StrutsTestCase for Cactus testing.
- Maybe some other Struts goodies lurking there that I've forgotten to mention.
For XDoclet folks, these are of interest:
- The strutsgen subproject uses custom templates and a custom tag handler demonstrating some powerful features of XDoclet.
- Use of Ant property substitution in XDoclet tags.
- Use of XDoclet template tags in merge points, showing how to do some conditional things out-of-the-box with XDoclet (turning Cactus servlet on and off, in this example).
The application itself is a document search engine, based on Lucene, and should run out of the box in Tomcat or JBoss. It even has the ability to (at build time) toggle between whether to use a session bean or not (functionality is the same either way). By default, you can simply deploy the WAR that you've built and it will work without EJB, but if you are interested in exploring the session bean piece it can be turned on.
I am in the process of creating much more detailed documentation, but I wanted to get this out sooner rather than later. If you find any problems or have any questions, please do not hesitate to let me know so I can refine it and post updates.
The one documentation I need to provide now is to note that you'll need j2ee.jar to build (from the J2EE 1.3+ SDK). I include all other API's. To build, unzip the file (link below) and it will expand into JavaDevWithAnt directory. In that directory, run Ant. If you have J2EE_HOME set you shouldn't need to do anything... just "ant". You'll also need to build a site index, so run "ant build-site-index". This is intentionally two separate steps. If you don't have J2EE_HOME set, then you need to provide j2ee.jar to the build. Do it this way:
ant -Dj2ee.jar=/path/to/my/j2ee.jar
Where "/path/to/my/j2ee.jar" is the actual path to your j2ee.jar
Post any questions/problems to me directly. E-mail me at JavaDevWithAnt@ehatchersolutions.com.
Download:
http://www.ehatchersolutions.com/downloads/
Latest version is 0.3, and its been proven to work on Windows and Mac OS X. You will need Ant 1.5(.1) and JUnit 3.8(.1).


Co-author of Lucene in Action
Ryan Bailey
Ranch Hand

Joined: Feb 26, 2002
Posts: 134
Hello Ted,
I would also like to know about validation with Struts. What happens if I want to validate a number to make sure it is greater than 0. For instance if I wanted to check someone's age on a form. Could the user enter -17 and would that be a valid answer since that is a valid integer? When I validate could I validate on a range of numbers?
Thanks in advance for your time,
Ryan


SCJP 1.4, SCWCD
Java: The power, elegance, and simplicity of a hand grenade
Ram Balasubramaniam
Greenhorn

Joined: Oct 19, 2001
Posts: 21
I have also started working on Struts Frame work recently.I am still in the process of getting to understand Struts fully.
I wanted to know , what TILES and VELOCITY does . Are they also used along with Struts ?
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Does the book cover DispatchAction?
Also - what exactly are tiles? Where can I find more info on them?
Thanks!
Graff
peter parker
Ranch Hand

Joined: Jul 11, 2001
Posts: 69
Hey Ted,
I'm working on my second site using Struts and really like it, but some days it can drive me up the f@#$% wall. Others have the same problem and the reason is simple. No CRUD examples w/Struts distribution. All the .war files that come with
the distribution are 'taste testers'. I'd love to work on struts-crud.war for the next release.
It would contain a CRUD with at least one example of all the struts tags and have ample code documentation.
Many developers have to go to your site and download Artimus or Scaffold, which are okay, but are not really suited for learning. We also search the web for struts issues and normally find ourselves in a threaded message boards or some site in japan....
Anyway, I don't mean to offend, as you've obviously given rebirth to JSP open source, but I hope you'll continue to keep up the good with Struts.
Thanks,
PP
Sun Certified Programmer for the Java 2 Platform
Sun Certified Web Component Developer for J2EE
John Holme
Ranch Hand

Joined: Oct 11, 2002
Posts: 54
Peter, as someone new to struts, I'd like to avoid as many pitfalls as possible. could you please elaborate on the nature of CRUD and why it has made your life difficult when developing with struts? thx.jh
peter parker
Ranch Hand

Joined: Jul 11, 2001
Posts: 69
Hey John,
CRUD - Create Retrieve Update Delete.
CRUD is used to describe common application functionality.
As for developing a CRUD using Struts, the Framework is very rigid, because it's so new which makes doing simple things complex. For instance, the Struts framework promotes using tags in JSP. However, let say you wanted to display 50 records and change the background color of the odd records. To do this you'll have to 'bend' the framework and use a scriptlet within JSP or create a custom tag...
That's a simple example, but in essence providing the purety of MVC (model-view-controller) architecture using Struts is not a simple task.
However, Struts is a big-step in the right direction.
Hope this helps
PP
Peter Pilgrim
Greenhorn

Joined: Nov 05, 2002
Posts: 21
Originally posted by Roger Garner:
Doesn't struts take care of all validation itself. I thought it had built in routines for integer and nulls?

Unfortunately Struts does not take care of all
validation. You can careful write `ActionForm'
beans to do this. When I developed a professional
Struts app for a financial bank, I called
the validation code in the action forms from
my `Action' classes. This is because the Action
hook into the business tier, calling the EJBs
via a business delegate or session facade.
Struts is a framework for the presentation tier.
I am also a core committer to the ``Expresso
Framework'', which integrates the Struts 1.0.2
MVC. For more infos
http://www.jcorporate.com/
I am also looking for Server Side Java developer
job in London, England
http://www.xenonsoft.demon.co.uk/curriculum-vitae.html
I have also written an article for `TheServerSide.com'
Regards
Peter Pilgrim


--<br />[bold]Peter Pilgrim[/bold]<br />Java EE Developer, Designer and Architect<br/>Oracle Java Champion<br /><a href="http://jroller.com/peter_pilgrim" target="_blank" rel="nofollow">http://jroller.com/peter_pilgrim</a>
Daniel Ng
Greenhorn

Joined: Jul 09, 2002
Posts: 27
Does this book contain tutorials also?
Rajani Deshpande
Ranch Hand

Joined: May 08, 2000
Posts: 45
where do I see the winners of previous giveaway?
I am participating for the first time.


Rajani
Eric Fletcher
Ranch Hand

Joined: Oct 26, 2000
Posts: 188
Ted,
I'm also new to Struts and I'm very interested hear any tip/examples you might have for the framework as a whole. I'm especially interested in incorporating Tiles in the views I'm working on.
Thanks,
E


My theory of evolution is that Darwin was adopted. - Steven Wright
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Originally posted by Rajani Deshpande:
where do I see the winners of previous giveaway?
I am participating for the first time.

You can see a list of past winners here.


Matthew Phillips
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

Hey Peter Parker,
In terms of the CRUD example, have you looked at the code generated by Karapan Sapi Struts code generator ?
Pho


Regards,

Pho
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Hi Ted,
Warmly welcome here.
I wonder how to write Unit test cases against Struts application? Does your book cover that topic?
Thanx.


Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
Reid M. Pinchback
Ranch Hand

Joined: Jan 25, 2002
Posts: 775
Originally posted by Ram Bal:
I have also started working on Struts Frame work recently.I am still in the process of getting to understand Struts fully.
I wanted to know , what TILES and VELOCITY does . Are they also used along with Struts ?

Can't comment on TILES. Velocity you can think of as being a Perl-like way of writing JSP pages. I worked on a couple of projects where we used it, and we found it to be a pain in the neck. Some people seem to really like it, so I guess it comes down to "your mileage will vary". If your intent is to have a clean MVC implementation, then you really have to think carefully about how you will organize your Velocity code. Struts the breakdown into MVC is already there for you.


Reid - SCJP2 (April 2002)
Johnny O'Boylan
Greenhorn

Joined: Feb 07, 2002
Posts: 21
JUnit is a good question! However, I was wondering about Log4j versus the new built-in logging capabilities of Java 1.4??? Does anyone have any pros/cons for Logging in Frameworks such as Struts?


==================================<br />If you choose not to decide,<br />you still have made a choice.<br />==================================
Sanjay Jadhav
Ranch Hand

Joined: Feb 21, 2002
Posts: 86
hello..
i am totaly new to this,how it going to help me in development, how is differnet from others.


Sanjay Jadhav<br />Sun Certified Programmer For Java 2 Platform
Albert Schweitzer
Greenhorn

Joined: Oct 25, 2002
Posts: 6
Hello Folks,
still working with JSPs, but Struts are coming next. (Maybe the book could help getting into the topic )
Greetz!


Kommt Zeit, kommt Bart!
Vedhas Pitkar
Ranch Hand

Joined: Jan 27, 2001
Posts: 445
Hi What is Struts anyway?
Pho Tek
Ranch Hand

Joined: Nov 05, 2000
Posts: 761

To Doug Wang,
To unit test your struts code, check out
http://sourceforge.net/projects/strutstestcase/
Cheers,
Pho
Ram Balasubramaniam
Greenhorn

Joined: Oct 19, 2001
Posts: 21
Thanks Reid,
Thanks for your inputs. I guess it saved me some time in finding out about Velocity. I do see a lot of posts on the struts forum abt the TILES and VELOCITY. So was interested.
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Wow, 25 posts, and Ted has yet to respond to any. Hmmmmmmmm.


GenRocket - Experts at Building Test Data
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Thanks Pho for your useful link.
Hi Gregg,
I think the discussion among participants here is very helpful to me.
See El
Ranch Hand

Joined: Oct 07, 2002
Posts: 44
Hi Ted,
I have some question regarding Struts & its futures :
1. How would you compare Struts to other Java-MVC frameworks like Turbine, Maverick, WebWork ?
2. Where do you see the place (how it can works together) for Struts in regarding with the coming Java Server Faces standard ?
3. Is there any standard about how to integrate Struts with IDE (as J2EE IDE/App generator are coming their way...) ?
4. What are direction that Struts will be evolved into (ie. features...) ?
Thanks for you time,


See El<br />SCJP2, SCWCD, IBM XML, SCBCD
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Originally posted by Gregg Bolinger:
Wow, 25 posts, and Ted has yet to respond to any. Hmmmmmmmm.

Ted has responded to a few posts, but not any in this particular thread.
Ted Husted
Author
Ranch Hand

Joined: Dec 02, 2002
Posts: 37
One of the greatest benefits of Struts is the active user community. I've been watching for orphan threads with no replies, but when others are already replying, I like to let the community speak for itself =:0)
If there are posts here that haven't been addressed, I'd suggest starting a new thread so it shows up on the BBS.
-Ted.


<a href="http://husted.com/struts/book.html" target="_blank" rel="nofollow">Struts in Action</a>
Rishi Singh
Ranch Hand

Joined: Dec 09, 2000
Posts: 321
Hi Ted,
Great to have you on the forum.How can Struts be used in conjunction with a Enterprise application.
Rishi Singh
SCJP,SCWCD
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Hi Ted,
How is ur book different from other books available in the market.
Ram Balasubramaniam
Greenhorn

Joined: Oct 19, 2001
Posts: 21
Hi Ted,
Originally posted by See El:
Where do you see the place (how it can works together) for Struts in regarding with the coming Java Server Faces standard ?

Does this mean Struts is going to integrate with Java Server Faces or is it going to be a framework similar to struts. Just like the Java Logging API in 1.4 to Log4J.
Engin Okucu
Ranch Hand

Joined: Feb 09, 2002
Posts: 174
How can i see the winners of this book ?
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Originally posted by Engin Okucu:
How can i see the winners of this book ?

A list of the winners may be found here.
lee kris
Ranch Hand

Joined: Mar 30, 2005
Posts: 35
hi Ted and every body,
I have been working on some project using the struts frame work. I have never heard of jakarta struts before to be honest but I was forced to work on it since my friend left the job which he has started in struts a while ago. Ever since then, I have been working hard to get to know this framework. This forum has been the biggest help and I want to thank the whole community for that. I am almost done with the project now. I think for a person new to stuts, the best thing will be to provide them with a simple, fully functional example that they can always refer to when they get lost. I did not get a good example that encapsulated most of the concepts of struts. So Ted do you have such an example in your upcoming book? Do you think it is a good idea to have an example like that people can have so that they learn faster?
Thank you and have a blessed day to you all.
Lee.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: This weeks giveaway