RE: Using a TreeModel for Menu State - Best Practice to sendstatechanges via Struts

2003-03-05 Thread Brian Hart
Remove the Tree Model from the equation then, this isn't a question about rich client 
UI.  The Struts specific question is how to pass parameters to the action class (and 
access them in the action class code)via the   tag without a 
formbean or form submission taking place.  I want a group of links to share the same 
action class and pass parameters into the ation class to correctly trigger some 
behavior.  This is primarily a request for content based on the menu action.  See 
below:

Arts 
English 

Is the above valid approach?  How do I get access to these parameters in the action 
class?  

>>> "BaTien Duong" <[EMAIL PROTECTED]> 03/05/03 11:36AM >>> 
This is what we are waiting for in Java Server Faces to bring server side 
action to rich client side interface with easy to use Tags. 

BaTien 
== 

-Original Message- 
From: Brian Hart [ mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 9:04 AM 
To: [EMAIL PROTECTED] 
Subject: Using a TreeModel for Menu State - Best Practice to send 
statechanges via Struts 


The TreeModel interface and DefaultTreeModel implementation of the JDK 
provide the necessary functionality to manage the state of a tree which will 
be managed in a set of database tables. We will be rendering the state of 
the tree in HTML. My question is how to build the HTML links to correctly 
communicate which link is clicked in Struts 1.1 RC1. I picture a single 
Action class, something like MenuAction that would then get a set of 
parameters indicating the node clicked and then delegate to the business 
object to update the TreeModel accordingly. Much of the documentation is 
about using ActionForms to pass information to the Struts Action. Without A 
Formbean how does one correctly use the action attribute of the  
tag in struts 1.1? 

Arts 
English 

Tree could be something like: 
Arts 
Music 
Learning Experiences 
Theature 
Best Practices 
ELA 
Learning Experiences 
Best Practices 





Remove the Tree Model from the equation then, this isn't a question about 
rich client UI.  The Struts specific question is how to pass parameters to 
the action class (and access them in the action class code)via the 
<html:link action="menu"/>  tag without a formbean or form submission 
taking place.  I want a group of links to share the same action class and 
pass parameters into the ation class to correctly trigger some behavior.  
This is primarily a request for content based on the menu action.  See 
below:
 
<html:link 
action="/menu?menuID=20&content_id=30">Arts</html:link> 
<html:link 
action="/menu?menuID=10&content_id=30">English</html:link> 
 
Is the above valid approach?  How do I get access to 
these parameters in the action class?  
 
>>> "BaTien Duong" <[EMAIL PROTECTED]> 03/05/03 
11:36AM >>> This is what we are waiting for in Java Server Faces to 
bring server side action to rich client side interface with easy to use 
Tags. BaTien == -Original 
Message- From: Brian Hart [ mailto:[EMAIL PROTECTED]">mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 05, 2003 9:04 AM To: mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED] 
Subject: Using a TreeModel for Menu State - Best Practice to send 
statechanges via Struts The TreeModel interface and 
DefaultTreeModel implementation of the JDK provide the necessary 
functionality to manage the state of a tree which will be managed in a set 
of database tables. We will be rendering the state of the tree in HTML. My 
question is how to build the HTML links to correctly communicate which link 
is clicked in Struts 1.1 RC1. I picture a single Action class, something 
like MenuAction that would then get a set of parameters indicating the node 
clicked and then delegate to the business object to update the TreeModel 
accordingly. Much of the documentation is about using ActionForms to pass 
information to the Struts Action. Without A Formbean how does one correctly 
use the action attribute of the <html:link> tag in struts 1.1? 
<html:link 
action="/menu?menuID=20&content_id=30">Arts</html:link> 
<html:link 
action="/menu?menuID=10&content_id=30">English</html:link> 
Tree could be something like: Arts Music Learning 
Experiences Theature Best Practices ELA Learning Experiences 
Best Practices 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Using a TreeModel for Menu State - Best Practice to send statechanges via Struts

2003-03-05 Thread Brian Hart
The TreeModel interface and DefaultTreeModel implementation of the JDK provide the 
necessary functionality to manage the state of a tree which will be managed in a set 
of database tables.  We will be rendering the state of the tree in HTML.  My question 
is how to build the HTML links to correctly communicate which link is clicked in 
Struts 1.1 RC1.  I picture a single Action class, something like MenuAction that would 
then get a set of parameters indicating the node clicked and then delegate to the 
business object to update the TreeModel accordingly.  Much of the documentation is 
about using ActionForms to pass information to the Struts Action.  Without A Formbean 
how does one correctly use the action attribute of the  tag in struts 1.1?

Arts
English

Tree could be something like:
Arts
  Music
Learning Experiences
  Theature
Best Practices 
ELA
  Learning Experiences
  Best Practices





The TreeModel interface and 
DefaultTreeModel implementation of the JDK provide the 
necessary functionality to manage the state of a tree which will be managed 
in a set of database tables.  We will be rendering the state of the tree in 
HTML.  My question is how to build the HTML links to correctly communicate 
which link is clicked in Struts 1.1 RC1.  I picture a single Action 
class, something like MenuAction that would then get a set of parameters 
indicating the node clicked and then delegate to the business object to update 
the TreeModel accordingly.  Much of the documentation is about using 
ActionForms to pass information to the Struts Action.  Without A Formbean 
how does one correctly use the action attribute of the  tag in 
struts 1.1?
 
ArtsEnglish
 
Tree could be something like:
Arts
  Music
    Learning 
Experiences
  Theature
    Best Practices 

ELA
  Learning Experiences
  Best Practices
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Understanding the Iterate Tag

2003-02-21 Thread Brian Hart
Your Example still Failed.  I received a no 'getter' method found for property 
Description.  As suggested I found the user guide and the logic below seems to be the 
proper equilvalent syntax of the scriptlet loop sample.  Does anyone else have further 
insight on the appropriate way to return a set of JavaBeans?  I am using JavaBeans to 
represent the Model and often want to return an array of them.  I don't use the 
ActionForm beans for this purpose as best practices indicate that you should not use 
the actionform as your model which makes perfect sense.  I was just confused as to the 
most efficient mechanism for passing the model back to the JSP page to render.  
Currently most of my business logic is design to bringback Javabean[] arrays when sets 
of data (not SQL Data, but various search engine results being consolidated into one 
searchResultBean)  are involved

<%
SearchResultBean[] c = (SearchResultBean[]) session.getAttribute("results");

for (int x = 0; x < c.length; x++){
  out.println(c[x].getDescription());
  
}
%>


   







Your Example still Failed.  I received a no 'getter' method found for 
property Description.  As suggested I found the user guide and the logic 
below seems to be the proper equilvalent syntax of the scriptlet loop 
sample.  Does anyone else have further insight on the appropriate way to 
return a set of JavaBeans?  I am using JavaBeans to represent the Model and 
often want to return an array of them.  I don't use the ActionForm beans 
for this purpose as best practices indicate that you should not use the 
actionform as your model which makes perfect sense.  I was just confused as 
to the most efficient mechanism for passing the model back to the JSP page to 
render.  Currently most of my business logic is design to bringback 
Javabean[] arrays when sets of data (not SQL Data, but various search engine 
results being consolidated into one searchResultBean)  are involved
 
<%SearchResultBean[] c = (SearchResultBean[]) 
session.getAttribute("results");
 
for (int x = 0; x < c.length; x++){  
out.println(c[x].getDescription());  }%>
 
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Understanding the Iterate Tag

2003-02-21 Thread Brian Hart
I have a JavaBean Array in the session scope which I can loop through in a scriptlet 
to output properties of each member of the array.
Example:
<%
SearchResultBean[] c = (SearchResultBean[]) session.getAttribute("results");

for (int x = 0; x < c.length; x++){
  out.println(c[x].getTitle());
  out.println(c[x].getDescription());
}
%>

What is the equivalent syntax for the above using the struts  tag?

Thank You,
Brian






I have a JavaBean Array in the session scope which I can loop through in a 
scriptlet to output properties of each member of the array.
Example:
<%SearchResultBean[] c = (SearchResultBean[]) 
session.getAttribute("results");
 
for (int x = 0; x < c.length; x++){
  out.println(c[x].getTitle());  
out.println(c[x].getDescription());}%>
 
What is the equivalent syntax for the above using the struts 
 tag?
 
Thank You,
Brian
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]