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: Struts View (JSP's -vs-Servlets)
Date Wed, 04 Jun 2003 13:28:27 GMT
<snip>
Question 1.  if my writeHTML() method returns HTML with struts tags will,
the struts tags be evaluated properly.
</snip>

No of course not.

<snip>
My problem is this.  I can create a java class for each attribute that i
need to use and my class can have a method such as "writeHTML()" which
returns HTML text
to display the attribute on a web page.
</snip>

Create a bean for each. Use taglibs and iteration etc... to display.
If this results in a complicated tag structure needed to output the stuff
then write your own tag that does what you would have done in writeHtml(),
or alternatively look into using the tile extension.

-----Original Message-----
From: news [mailto:news@main.gmane.org]On Behalf Of sjones
Sent: Wednesday, 4 June 2003 21:16
To: struts-user@jakarta.apache.org
Subject: Struts View (JSP's -vs-Servlets)


I am writing an application that will Access an LDAP Directory Server

The directory has many, many attributes and an attribute may be a single
element
or an array of elements.

Using an entry of the type- employee we have this example.

Example:  A phone number attribute will store as many phone numbers as
needed.
                Cost Center element will always have just a single value.


My problem is this.  I can create a java class for each attribute that i
need to use
and my class can have a method such as "writeHTML()" which returns HTML text
to display the attribute on a web page.

In doing this, I don't have to code the HTML tag for this on every page in
my
web app that needs to display this attribute.  I can simply call the
writeHTML method
from the class and have the same code throught the APP.

It would seem to me that a servlet is a better choice for implmenting a
view.

Question 1.  if my writeHTML() method returns HTML with struts tags will,
the struts
                   tags be evaluated properly.

Question 2  can u do this in a JSP page:

                         <%=
                                 "<html:text property=\""  + fld_nme + "\" "
+  " value=\"" + fld_val + "\">";
                         %>




---------------------------------------------------------------------
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