struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: Why html:xxx tags? / Dreamweaver and .do extension
Date Mon, 07 Jul 2003 04:24:58 GMT
Another plus to the struts tags is the nesting ability, which imho rocks!
(Though Im not actually using JSP so had to render the nesting details the
hard way...)

-----Original Message-----
From: Ted Husted [mailto:husted@apache.org]
Sent: Sunday, 6 July 2003 05:02
To: Struts Users Mailing List
Subject: Re: Why html:xxx tags? / Dreamweaver and .do extension


tek1 wrote:
> Sorry for the newbie questions, but...
>
> [ Why html:xxx tags? ]
>
> On the .jsp page, why is it necessary to replace the standard html tags
> with the Struts-specific ones (i.e. "html:form" instead of just "form").
> In other words, what special features of Struts requires these specially
> defined tags?

In a dynamic web application there has to be some mechanism for
transfering information from the server-side action into the server
page. One approach is to do this inside the HTML markup with JSP
scriptlets, but that is clumsy and error-prone. Another approach is to
have a custom JSP tag print out both the HTML tag and the dynamic
content, which is what the Struts tags do.

The Struts HTML tags are aware of where the framework stores
information, and so, in practice, become quite easy to use.

The core framework is unaware of the tags and works just as well with
other approaches. There are both XLS and Velocity Template extension for
Struts that work just fine with out the tags. The Velocity Templates
(.vm) work particularly well in visual HTML editors "out of the box".


> [ Dreamweaver and .do extension ]
>
> If there are any Dreamweaver users out there, how do you specify that
> Dreamweaver also open files that end with .do (and .vm)?  I tried adding
> the extensions under "Edit" -> "Preferences" -> "File Types / Editors"
> Category -> "Open in Code View", but it didn't work.  I would actually
> prefer to open them in Dreamweaver's visual/GUI editor, but looks like
> that is not an option.

Struts doesn't actually use ".do" files. These are virtual files that
bundled together a server-side action with one or more output files
(such as JSPs or Velocity Templates).

So the servlet sees the *.do extension and passes the request to the
Struts ActionServlet. The Servlet then passes it along to the
server-side Struts Action class, which does whatever it needs to do,
places any dynamic data that might be needed in the request, and helps
select the server page (of whatever kind) to render that data.

The server page retrieves the dynamic data from the request, using
either Struts tags (origInal, JSTL, or extra crispy), or Velocity Tools,
or from a DOM created by an extension like stxx, or any other
presentation device that can access the Java request object.

-Ted.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message