You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vincent Stoessel <vi...@xaymaca.com> on 2002/06/26 18:04:22 UTC
Learning by doing: longer
I think I will go for "JSP Site Design", thanks for that.
OK, it's time for me to get real basic here.
I want to make the ulimate "Hello MVC Struts" app from scratch as a
learning exercise and for a tutorial that I will freely post and give away.
Platform: tomcat 4.01 , struts 1.1 with included tiles.
Dev tools: forte for java 4.0 CE and emacs when I get tired of the GUIs.
Goal:to make a mvc struts app so basic that a beginner can understand
the basic structure of the framework. all it has to do is display
"You are learning well" on a web page if you login sucessfully
or take users to an error page if login is not sucessfull.
For simplicity, the username and passwd can be stored in a local file.
The old jsp designer in me would plan out a series of web pages
that would execute JSP applications in a linear fashion or all on
one page (yes, the dreaded embedded scriptlet code in one jsp page).
I now know that the logic needs to be separated into a bean(taglib?)
I've seen all the model 2 diagrams and understand how it all works in
theory. But from a partical struts point of view I'm baffled by the
naming conventions (everything is named Action*). Is my business
logic supposed to be contained in a class, bean or taglib?
I am new to taglib thing and I am looking for a good
boook, online tutorial on that as well.
So what is the first step, creating a struts-config file, writing the
business logic class/bean/taglib or drawing a pretty visio diagram?
Thanks in advance.
Dave Hodson wrote:
> Get a copy of either "JSP Site Design" or "JSP Web Development"
> They have pretty good examples...
>
> (JSP Site Design has a much more in-depth look at Struts than does "JSP Web Development", which is more of a beginner's guide to JSP)
>
> Dave
>
>
>
> ---
> Dave Hodson
> MessageCast, inc.
> Email: dave@messagecast.net <ma...@messagecast.net>
> www.messagecast.net
>
>
>
>>-----Original Message-----
>>From: Vincent Stoessel [mailto:vincent@xaymaca.com]
>>Sent: Tuesday, June 25, 2002 2:50 PM
>>To: Struts Users
>>Subject: learning by doing: newbie alert
>>
>>
>>Hello,
>>I have been doing a lot of reading lately about struts
>>and have tried modifying examples and such. I have really
>>been trying to
>>just mess with things till I get a feel as to how all this works.
>>This thing has a lot of moving parts. :)
>>
>>I am getting frustrated but I know that is a normal part
>>of learning something new, so I trudge on.
>>
>>I'm still trying to understand how to start adding
>>my own functionality to the default struts webapps.
>>For example my goal right now is to create a simple
>>login screen that authenticates off a jdbc data source.
>>Do I have to write a taglib in order to do this?
>>Maybe we need a struts-stripped-down-basic-example.war ?
>>Thanks
>>
>>
>>--
>>Vincent Stoessel
>>Linux Systems Developer
>>vincent xaymaca.com
>>
>>
>>--
>>To unsubscribe, e-mail:
>><ma...@jakarta.apache.org>
>>For additional commands, e-mail:
>><ma...@jakarta.apache.org>
>>
>>
>
> --
> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Vincent Stoessel
Linux Systems Developer
vincent xaymaca.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Learning by doing: longer
Posted by Joe Germuska <Jo...@Germuska.com>.
>So what is the first step, creating a struts-config file, writing
>the business logic class/bean/taglib or drawing a pretty visio
>diagram?
Last time I started a Struts project, I began by identifying all the
action mappings I'd need. I was sort of operating along the lines of
the Struts Catalog principle "Organize ActionMappings into a command
structure" (<http://husted.com/struts/catalog.htm>). Think of the
path mappings as the "API" of your web app. If you define that, you
can be pretty free about changing the implementation behind them,
while having enough structure that page designers (if they aren't
you) can move ahead in parallel with the coding of the Actions. Of
course, Struts makes it trivially easy to change what lies behind the
mappings, so at an early stage, you can actually map directly to JSPs
so people can get a click-through experience (good for UI
prototyping) and then just plug functionality in behind the Struts
config file as you build it.
This approach led some of my colleagues to try to automate the next
steps, which led us to the StrutsBuilder project
(<http://sourceforge.net/projects/rivernorth/>) StrutsBuilder let's
you build up the struts config file in a GUI (or import one) and then
generate stub action classes, JSPs, and other pieces (working from
Velocity templates which you can customize, although admittedly we
haven't exactly documented how you'd do that...).
Of course, we're not the only ones who've written code generation
tools, but I haven't had much experience with any others.
As for diagramming... if you like that approach, you could check out
Scioworks Camino, which is a visual struts building tool. I haven't
had great success with it, but I haven't tried their latest versions.
And last week on the list we touched on discussions about how to use
UML to describe Struts projects. I reviewed the WebUML spec over the
weekend and found it kind of peculiar in a few ways. It could be
adapted to Struts, but I'm not sure that I'm enthusiastic enough
about the spec to push that. It seems kind of outdated, and it
hasn't changed from 0.9 in over three years. Still, it has at least
one published book behind it, and some support in popular UML tools.
(see
<http://www.conallen.com/whitepapers/webapps/ModelingWebApplications.htm>
for details.)
Joe
--
--
* Joe Germuska { joe@germuska.com }
"It's pitiful, sometimes, if they've got it bad. Their eyes get
glazed, they go white, their hands tremble.... As I watch them I
often feel that a dope peddler is a gentleman compared with the man
who sells records."
--Sam Goody, 1956
tune in posse radio: <http://www.live365.com/stations/289268>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>