Java Struts: Book Recommendation?

S

Steve

I'm an experienced Java/JSP programmer.

I don't know anything about struts. I was poking around on Amazon.
Most of the books seemed to be very old and very large/bloated.....as
well as not being free of significant complaints.

I'm looking for a good introductory book, preferably not to large/
bloated.

Care to recommend a title?

Thanks in advance
 
A

Arne Vajhøj

I'm an experienced Java/JSP programmer.

I don't know anything about struts. I was poking around on Amazon.
Most of the books seemed to be very old and very large/bloated.....as
well as not being free of significant complaints.

I'm looking for a good introductory book, preferably not to large/
bloated.

Care to recommend a title?

Given that Struts is old (I am assuming Struts 1 here!), then
an old book should not be a problem.

I like "Struts in Action".

Arne
 
D

David Segall

Steve said:
I'm an experienced Java/JSP programmer.

I don't know anything about struts. I was poking around on Amazon.
Most of the books seemed to be very old and very large/bloated.....as
well as not being free of significant complaints.

I'm looking for a good introductory book, preferably not to large/
bloated.

Care to recommend a title?

I cannot recommend it but I am happy to give you "Struts The Complete
Reference" if you pay the postage. It covers Struts 1.2 and is the
first edition of this <http://www.jamesholmes.com/StrutsTCR/>. It is
large (over 500 pages) and paying the postage may too expensive
because I am in Australia. The reason I can't recommend it is because
I had a brief look at the book and fled to JSF.

Email me at david at segall . net if you feel like it.
 
L

Lew

David said:
I cannot recommend it but I am happy to give you "Struts The Complete
Reference" if you pay the postage. It covers Struts 1.2 and is the
first edition of this<http://www.jamesholmes.com/StrutsTCR/>. It is
large (over 500 pages) and paying the postage may too expensive
because I am in Australia. The reason I can't recommend it is because
I had a brief look at the book and fled to JSF.

Fair dinkum, mate. JSF is superior IMO also.
 
S

Steve

Given that Struts is old (I am assuming Struts 1 here!), then
an old book should not be a problem.

I like "Struts in Action".

I'm concerned that an older book may not cover new developments in
struts. Is this a valid concern with "Struts in Action"?

Also is the proper name "Jakarta Struts" versus "Java Struts"?

Thanks Arne

Steve
 
S

Steve

I cannot recommend it but I am happy to give you "Struts The Complete
Reference" if you pay the postage.

LOL! :) Thanks. I feel you pain. I have a few textbooks like that
myself. Some of them are being used to boost up my monitor. One of
these days I will schlep them to a recycling center so I don't have to
feel guilty for throwing out a book :).


I had a brief look at the book and fled to JSF.

What is JSF? Java Sever F____ ?

Thanks

Steve
 
A

Arne Vajhøj

Fair dinkum, mate. JSF is superior IMO also.

It is a lot newer, so if it were not, then somebody would
really have fucked up.

But there is still a lot of Struts code out there that need
to be maintained.

Arne
 
S

Steve


Funny!, I'm totally using that site and I'm not giving you credit.
Who would of thought, an elegant way of RTFMing people :)


It looks like the same idea, just a different implementation.

I worked for a company that sort of rolled their own. A dispatcher
servlet, taking requests, reading a database table, then deciding to
send the user to a java class, JSP or HTML page as a response.

That is what struts and JSF seem like.
 
L

Lew

Steve said:
I worked for a company that sort of rolled their own. A dispatcher
servlet, taking requests, reading a database table, then deciding to
send the user to a java [sic] class, JSP or HTML page as a response.

That is what struts and JSF seem like.

I've "hand-rolled" a number of those so-called "Model 2" sites also. JSF is
rather different. Unlike Struts, it doesn't use a single front-controller
model, but uses a multiplicity of controllers - loosely speaking, one per
screen. It also imposes a component model on the screens, sort of like Swing
or other GUI frameworks, but of course different in order to work on the Web.

The expansion of JSF into facelets and XHTML makes it even groovier.

I came from the front-controller world of Model 2 and Struts into JSF myself.
It took some getting used to, but now I find it very useful.
 
T

Tom Anderson

Steve said:
I worked for a company that sort of rolled their own. A dispatcher
servlet, taking requests, reading a database table, then deciding to
send the user to a java [sic] class, JSP or HTML page as a response.

As an aside, Lew, do you think the [sic] is necessary in blocks quoted
using the > convention? Doesn't that already imply literal,
copy-and-paste, quotation? Isn't using both a bit like writing "java [sic]
[sic]", which implies that someone actually wrote "java [sic]"? I
appreciate that if you were quoting inline, the [sic] would be
appropriate, but here it seems not just redundant but erroneous.
JSF is rather different. Unlike Struts, it doesn't use a single
front-controller model, but uses a multiplicity of controllers - loosely
speaking, one per screen. It also imposes a component model on the
screens, sort of like Swing or other GUI frameworks, but of course
different in order to work on the Web.

I've never used JSF. I knew about the component model stuff, but i hadn't
heard about the multiple controllers. Would you say that either is a
bigger part of JSF than the other? Is it possible to use the multiple
controllers with plain JSP, should you want to? Would it be possible for
you to write or direct me to a brief explanation of how the multiple
controllers work?
I came from the front-controller world of Model 2 and Struts into JSF
myself. It took some getting used to, but now I find it very useful.

Have you had any contact with Stripes at all? My knowledge of web
frameworks is embarrassingly limited, and this is something i am slowly
trying to address. I worked with plain old J2EE back in the day, and since
coming back to programming have been working with something called ATG
Dynamo, which is a bit of a beast [1], but does have a flexible and
tractable web framework. I've started playing with Stripes in my own time;
it was written by people who'd used Struts 1 but weren't happy with it, so
i assume it is similar but superior to that. It's not a million miles from
what ATG does, which is helpful, but i'm curious as to whether there are
frameworks which use a radically different model.

Anyway, Stripes, i would say, has a single controller with no
intelligence. You set up its filter and dispatcher servlet in your
web.xml, which don't really take any app-specific configuration, then in
your JSP, you write:

<stripes:form beanclass="com.initech.smslottery.PlayActionBean">
<stripes:text name="mobilePhoneNumber"/>
<stripes:submit name="play" value="Play!"/>
</stripes:form>

And in your code you write:

package com.initech.smslottery;
public class PlayActionBean implements ActionBean {
// a few minor details omitted
private String mobilePhoneNumber;
public String getMobilePhoneNumber() {return mobilePhoneNumber;}
public void setMobilePhoneNumber(String mobilePhoneNumber) {this.mobilePhoneNumber = mobilePhoneNumber;}
public Resolution play() {
enterNumberIntoLottery(mobilePhoneNumber);
return new ForwardResolution("/lottery/thanks.jsp");
}
}

When you submit the form, the controller finds the class named in the
beanclass attribute of the stripes:form element, creates an instance, then
for each stripesified input in the form, calls the corresponding setter on
it, then calls the handler method named in the stripes:submit element.
That does what it needs to do, then returns a Resolution which indicates
what the response to the browser should be (usually a redirect to a page
or another form; Stripes is built around the redirect-after-post pattern
of request handling, although i think you can serve a page back directly),
which the controller duly puts into action.

However, it's possible my terminology is wrong here - it might be that the
ActionBeans are controllers, in which case there is one per page (ish).

tom

[1] It's also the Snake Plissken of app frameworks; whenever i mention to
people, the response, if they've heard if it, is "I thought that was
dead".
 
L

Lew

Steve said:
I worked for a company that sort of rolled their own. A dispatcher
servlet, taking requests, reading a database table, then deciding to
send the user to a java [sic] class, JSP or HTML page as a response.

Tom said:
As an aside, Lew, do you think the [sic] is necessary in blocks quoted
using the > convention? Doesn't that already imply literal,
copy-and-paste, quotation? Isn't using both a bit like writing "java
[sic] [sic]", which implies that someone actually wrote "java [sic]"? I
appreciate that if you were quoting inline, the [sic] would be
appropriate, but here it seems not just redundant but erroneous.

OK.

Don't you think that people using the Java language should at the very
freaking least spell the name of the language correctly? I do.

I take such carelessness as symptomatic or emblematic of the crappy code I
often inherit on projects at work.

Tom said:
I've never used JSF. I knew about the component model stuff, but i [sic]
:)

hadn't heard about the multiple controllers. Would you say that either
is a bigger part of JSF than the other? Is it possible to use the

"Part"? Ok, in the sense of "aspect", they're as big a part of JSF as the
fact that it uses tags or works in web-based applications.
multiple controllers with plain JSP, should you want to? Would it be

Of course. You can hand-code anything a framework provides.
possible for you to write or direct me to a brief explanation of how the
multiple controllers work?

<http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html>

The front-controller pattern is a simplified form of the MVC pattern.

Lew:
tom:
Have you had any contact with Stripes at all? My knowledge of web

Only the movie starring Bill Murray, et al.

[snip]
[1] It's also the Snake Plissken of app frameworks; whenever i mention

Great reference! Good ol' one-eyed Snake!
to people, the response, if they've heard if it, is "I thought that was
dead".

In the sequel Peter Fonda's character prepares to ride the impending tsunami.
You know what it means when you're conversing with a tsunami surfer? It
means they haven't done it yet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top