Re: Book Opinions

2002-10-20 Thread Vernon Wu
Nat,

I am thinking about walking the opposite direction as you do. After playing about the 
Pet Market from Macromedia MX, I 
wish my Java Web application have the degree of rich UI. You might be able to tell me 
how to add the MX on the top 
of Struts, or similar MVC Java web application: replaying JSP, the "V" with MX, also 
the "V" with least possible work.

I don't know any Struts books out there. But you shall be able to find tons of on-line 
tutorial in the subject. Remember 
"Google is yor friend". One book I can recommend is "Advanced JaveServer Pages" by 
David Geary. The frameworks 
introduced in the book are very similar with those in Struts, including MVC one.

If you want to write back, please send to my email address.

Regards,

Vernon  

10/20/2002 9:32:49 PM, "Nat Papovich" <[EMAIL PROTECTED]> wrote:

>Hello All -
>
>I'm a recent addition to this list, while I begin learning Struts. Not only am I
>beginning to learn Struts, I'm beginning to learn all things Java.
>
>I come from a ColdFusion/Fusebox background, but as a "leader" in that
>community, I have secretly wanted more structure from a framework, along with
>transitioning to a more "robust" web language. Fusebox also does an incomplete,
>kludgy job dealing with MVC, of which I am fond.
>
>I'm quickly getting knee-deep in many resources, and am burning through my old
>"to be read" book collection of OO programming and JSP (working on Bruce Eckel's
>Thinking in Java now). I consider myself to be well-versed in OO, very
>comfortable with structured programming (structured meaning well-designed in
>this case, not opposed to OO), but being a huge proponent of ColdFusion's
>leading framework, I recognize the importance of starting off on the right foot
>in my J2EE adventure (and think Struts is that right foot).
>
>That exhaustive background was meant to help you fine folks make book
>recommendations for me. I have bookmarked and visit some of the excellent online
>resources for Struts and Java, but I'm the kind of guy who likes to spend money,
>have something bound, with a glossy cover, sitting on my desk - it's like a
>security blanket to me.
>
>So of the apparently excellent titles either currently available or
>soon-to-be-released, which one should I start with? Undoubtedly, I will acquire
>another, and another, but for now... ?
>
>Thanks,
>NAT
>
>Nat Papovich
>Senior Partner & Lead Architect
>Fusium, Inc.
>503-913-1659
>Buy the book: http://fusium.com/go/book
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Book Opinions

2002-10-20 Thread Nat Papovich
Hello All -

I'm a recent addition to this list, while I begin learning Struts. Not only am I
beginning to learn Struts, I'm beginning to learn all things Java.

I come from a ColdFusion/Fusebox background, but as a "leader" in that
community, I have secretly wanted more structure from a framework, along with
transitioning to a more "robust" web language. Fusebox also does an incomplete,
kludgy job dealing with MVC, of which I am fond.

I'm quickly getting knee-deep in many resources, and am burning through my old
"to be read" book collection of OO programming and JSP (working on Bruce Eckel's
Thinking in Java now). I consider myself to be well-versed in OO, very
comfortable with structured programming (structured meaning well-designed in
this case, not opposed to OO), but being a huge proponent of ColdFusion's
leading framework, I recognize the importance of starting off on the right foot
in my J2EE adventure (and think Struts is that right foot).

That exhaustive background was meant to help you fine folks make book
recommendations for me. I have bookmarked and visit some of the excellent online
resources for Struts and Java, but I'm the kind of guy who likes to spend money,
have something bound, with a glossy cover, sitting on my desk - it's like a
security blanket to me.

So of the apparently excellent titles either currently available or
soon-to-be-released, which one should I start with? Undoubtedly, I will acquire
another, and another, but for now... ?

Thanks,
NAT

Nat Papovich
Senior Partner & Lead Architect
Fusium, Inc.
503-913-1659
Buy the book: http://fusium.com/go/book


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




[ANNOUNCE] SVT 0.5.0-beta released

2002-10-20 Thread Shinya Kasatani
Hello,

I am pleased to announce that I have released a first version of SVT
(Struts Validation Toolkit).
SVT is a form validation framework for Struts.

You can write a simple validating code in Java, rather than
writing validation.xml files.

For example, if the form bean has properties "name" and "age",
both is required, and "age" must be a number,
the validation code looks like this:

public class InputForm extends ActionForm {


public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {

Validator v = new Validator(getServlet(), this, mapping.getName());
v.validate("name", Rules.required());
v.validate("age", new Rule[] { Rules.required(), Rules.number() });
return v.getErrors();
}
}

You can get it from http://svt.sourceforge.net/

If you have any comments please write to [EMAIL PROTECTED]

-- 
Shinya Kasatani <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: access ApplicationResource from ActionForm

2002-10-20 Thread Arion Yu
Hi all,

for ApplicationResource, check ActionForm.getServlet.getResources
for the locale, however, the variable is protected and you have no way 
to access it in this way.

One of the way to accomplish it is pre-create the form in Action (before 
going to JSP) and set the locale during the Action phase.


Would there be other way like adding a locale variable in ActionForm? Or 
a public getLocale in ActionServlet ?

Arion

P.S. my version is 1.0.2

Darren Hill wrote:

Hi All,

My ActionForm is populating a drop-down list ( LabelvalueBean's ) and I want
to say "- None -" for a none-selection .. and want it to be i18n.  So, can I
access the ApplicationResource to retrieve that 'None'.  If so, how?

Is this the best idea?

Darren.

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to add a pre-action

2002-10-20 Thread Phil Steitz
Howard Miller wrote:

That helps a lot... just one question if you don't mind... can I check how you would 
forward from the prepareListBookAction to the bookSearch.jsp. I assume you are just 
using mapping.findForward( "success" ). That didn't work for me... which is really why 
I started thinking that I was doing totally the wrong thing. Could (of course) be some 
stupid error!

Yes, on successful completion,  PrepareListBookAction.perform() ends with

return (mapping.findForward("success"));

If you are getting a blank page, there is most likely something wrong 
with your jsp.  Check your container logs.

I'm off to try harder... thanks!

HM

On 20 Oct 2002 at 10:10, Phil Steitz wrote:



Howard Miller wrote:


I think I'm seriously missing the point here! I have looked at the example application 
in some detail and it appears to add a parameter (eg, ?action=new) to tell the action 
for a form to perform an initialising action. I don't see it using a "pre-" action.

I am incredibly stuck with the concept of how to code an action that is not 
encumbered with *special* parameters to pre-load the bean data. My particular 
problem is that I have pages where the previous page cannot be predicted, so the jsp 
must have a means of loading its own data.

I would really appreciated some pointers as to how to set this up. *** I particularly 
don't understand how to get the action to call the following JSP *** (ie, I would really 
appreciate some specific - example - help on this!! ). At least every method I have 
tried doesn't work.

Here is a simple example showing one way to deal with this type of 
thing. There are no doubt lots of other ways to handle this.

Use case: library search.  User page flow: main menu -> search input 
page (bookSearch.jsp) -> search results page (listBook.jsp).  The search 
input page needs to be pre-populated with a list of currently defined 
subjects.

Struts processing flow: main menu -> search input pre-populate action 
(PrepareListBookAction) -> search input page (bookSearch.jsp) -> search 
processing action (ListBookAction) -> search results page (booklist.jsp).

In struts-config:



	name="bookSearchForm"
	type="com.steitz.library.PrepareListBookAction"
validate="false"
	scope="request">
	




	name="bookSearchForm"
	type="com.steitz.library.ListBookAction"
scope="request"
	input="/a/bookSearch.jsp"
	validate="true">
	


In the main menu:



(here "index.find" = "Find a Book".)

PrepareListBookAction retrieves the list of currently defined subjects 
and sets a property of the (automatically created) BookSearchForm for 
the book search input form (bookSearch.jsp) to use.

The key concept is that instead of linking/forwarding to the input jsp 
directly, you link/forward to the pre-population action and then have 
the pre-population action set up the form bean and then forward to the 
input jsp.

Hope this helps,

Phil








I do understand how to actually create a bean manually and put in in the scope. I 
don't understand how to set up a generic preload action for a given JSP/ActionForm, 
and what the config should look like.

Again, any help much appreciated.

HM

On 20 Oct 2002 at 8:43, David M. Karr wrote:



"Howard" == Howard Miller <[EMAIL PROTECTED]> writes:



  Howard> Hi,
  Howard> Can somebody kindly help me with the following...

  Howard> I want to add a path and an Action class. The action class will then preload data into 
  Howard> a bean and then forward (do I mean forward) to the jsp that displays the bean. That's 
  Howard> it. I want this action to be in *addition* to the *normal* jsp/formbean/action setup.

  Howard> I can't see how to do it in particular

  Howard> 1. I don't think I fully understand how/why an action is associated with a bean in 
  Howard> struts-config. What does the action servlet do with this information.

  Howard> 2. How do I properly forward from an action to a jsp with the bean information intact. 
  Howard> It seems to be very similar to an action returning its "input form" to display errors, but 
  Howard> doing this doesn't work.  Whatever I do I seem to get a blank page.

In fact, the best practice is to always preface a page with an action.  You end
up with actions that prepare information for a page, and actions which process
information for a page.  The actions which process the page information will
always have had the form bean created before you get to the action.  However,
the actions which prepare the page information may have to manually create the
form bean and put it into the appropriate scope.

Note that the welcome page for an application would normally be something like
"index.jsp", which does nothing but forward to an action to start the
application.  You can't preface the welcome page with an action, but you can
make it do nothing but go to an action to prepare the real first page.

Look at the source code for the "example" a

Re: about images and db

2002-10-20 Thread kiuma
Of course I din't know if it was related with struts
Now I know that struts doesn't have any kind of facilitation for this 
task. (I mean jsp tags),
and I know how to put dyna imgs in my pages.

Anyway I prefer mailarchive, I think it was better old dejanews

Tero P Paananen wrote:

What could you suggest to me to display images stored in a database.
When I get them in a bean what could I do to show them on a web d. page?



How is this related to Struts?

Did you Google for answers before posting?

-TPP




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to add a pre-action

2002-10-20 Thread Howard Miller
That helps a lot... just one question if you don't mind... can I check how you would 
forward from the prepareListBookAction to the bookSearch.jsp. I assume you are just 
using mapping.findForward( "success" ). That didn't work for me... which is really why 
I started thinking that I was doing totally the wrong thing. Could (of course) be some 
stupid error!

I'm off to try harder... thanks!

HM

On 20 Oct 2002 at 10:10, Phil Steitz wrote:

> Howard Miller wrote:
> > I think I'm seriously missing the point here! I have looked at the example 
>application 
> > in some detail and it appears to add a parameter (eg, ?action=new) to tell the 
>action 
> > for a form to perform an initialising action. I don't see it using a "pre-" action.
> > 
> > I am incredibly stuck with the concept of how to code an action that is not 
> > encumbered with *special* parameters to pre-load the bean data. My particular 
> > problem is that I have pages where the previous page cannot be predicted, so the 
>jsp 
> > must have a means of loading its own data.
> > 
> > I would really appreciated some pointers as to how to set this up. *** I 
>particularly 
> > don't understand how to get the action to call the following JSP *** (ie, I would 
>really 
> > appreciate some specific - example - help on this!! ). At least every method I 
>have 
> > tried doesn't work.
> 
> Here is a simple example showing one way to deal with this type of 
> thing. There are no doubt lots of other ways to handle this.
> 
> Use case: library search.  User page flow: main menu -> search input 
> page (bookSearch.jsp) -> search results page (listBook.jsp).  The search 
> input page needs to be pre-populated with a list of currently defined 
> subjects.
> 
> Struts processing flow: main menu -> search input pre-populate action 
> (PrepareListBookAction) -> search input page (bookSearch.jsp) -> search 
> processing action (ListBookAction) -> search results page (booklist.jsp).
> 
> In struts-config:
> 
> 
> name="bookSearchForm"
>   type="com.steitz.library.PrepareListBookAction"
>  validate="false"
>   scope="request">
>   
>  
> 
>  
> name="bookSearchForm"
>   type="com.steitz.library.ListBookAction"
>  scope="request"
>   input="/a/bookSearch.jsp"
>   validate="true">
>   
>  
> 
> In the main menu:
> 
> 
>  
> (here "index.find" = "Find a Book".)
> 
> PrepareListBookAction retrieves the list of currently defined subjects 
> and sets a property of the (automatically created) BookSearchForm for 
> the book search input form (bookSearch.jsp) to use.
> 
> The key concept is that instead of linking/forwarding to the input jsp 
> directly, you link/forward to the pre-population action and then have 
> the pre-population action set up the form bean and then forward to the 
> input jsp.
> 
> Hope this helps,
> 
> Phil
> 
> 
> 
> 
> 
> 
> 
> > 
> > I do understand how to actually create a bean manually and put in in the scope. I 
> > don't understand how to set up a generic preload action for a given 
>JSP/ActionForm, 
> > and what the config should look like.
> > 
> > Again, any help much appreciated.
> > 
> > HM
> > 
> > On 20 Oct 2002 at 8:43, David M. Karr wrote:
> > 
> > 
> >>>"Howard" == Howard Miller <[EMAIL PROTECTED]> writes:
> >>
> >>Howard> Hi,
> >>Howard> Can somebody kindly help me with the following...
> >>
> >>Howard> I want to add a path and an Action class. The action class will then 
>preload data into 
> >>Howard> a bean and then forward (do I mean forward) to the jsp that displays 
>the bean. That's 
> >>Howard> it. I want this action to be in *addition* to the *normal* 
>jsp/formbean/action setup.
> >>
> >>Howard> I can't see how to do it in particular
> >>
> >>Howard> 1. I don't think I fully understand how/why an action is associated 
>with a bean in 
> >>Howard> struts-config. What does the action servlet do with this information.
> >>
> >>Howard> 2. How do I properly forward from an action to a jsp with the bean 
>information intact. 
> >>Howard> It seems to be very similar to an action returning its "input form" to 
>display errors, but 
> >>Howard> doing this doesn't work.  Whatever I do I seem to get a blank page.
> >>
> >>In fact, the best practice is to always preface a page with an action.  You end
> >>up with actions that prepare information for a page, and actions which process
> >>information for a page.  The actions which process the page information will
> >>always have had the form bean created before you get to the action.  However,
> >>the actions which prepare the page information may have to manually create the
> >>form bean and put it into the appropriate scope.
> >>
> >>Note that the welcome page for an application would normally be something like
> >>"index.jsp", which does nothing but forward to an action to start the
> >>application.  Y

Re: How to add a pre-action

2002-10-20 Thread Phil Steitz
Howard Miller wrote:

I think I'm seriously missing the point here! I have looked at the example application 
in some detail and it appears to add a parameter (eg, ?action=new) to tell the action 
for a form to perform an initialising action. I don't see it using a "pre-" action.

I am incredibly stuck with the concept of how to code an action that is not 
encumbered with *special* parameters to pre-load the bean data. My particular 
problem is that I have pages where the previous page cannot be predicted, so the jsp 
must have a means of loading its own data.

I would really appreciated some pointers as to how to set this up. *** I particularly 
don't understand how to get the action to call the following JSP *** (ie, I would really 
appreciate some specific - example - help on this!! ). At least every method I have 
tried doesn't work.

Here is a simple example showing one way to deal with this type of 
thing. There are no doubt lots of other ways to handle this.

Use case: library search.  User page flow: main menu -> search input 
page (bookSearch.jsp) -> search results page (listBook.jsp).  The search 
input page needs to be pre-populated with a list of currently defined 
subjects.

Struts processing flow: main menu -> search input pre-populate action 
(PrepareListBookAction) -> search input page (bookSearch.jsp) -> search 
processing action (ListBookAction) -> search results page (booklist.jsp).

In struts-config:



	name="bookSearchForm"
	type="com.steitz.library.PrepareListBookAction"
validate="false"
	scope="request">
	




	name="bookSearchForm"
	type="com.steitz.library.ListBookAction"
scope="request"
	input="/a/bookSearch.jsp"
	validate="true">
	


In the main menu:



(here "index.find" = "Find a Book".)

PrepareListBookAction retrieves the list of currently defined subjects 
and sets a property of the (automatically created) BookSearchForm for 
the book search input form (bookSearch.jsp) to use.

The key concept is that instead of linking/forwarding to the input jsp 
directly, you link/forward to the pre-population action and then have 
the pre-population action set up the form bean and then forward to the 
input jsp.

Hope this helps,

Phil








I do understand how to actually create a bean manually and put in in the scope. I 
don't understand how to set up a generic preload action for a given JSP/ActionForm, 
and what the config should look like.

Again, any help much appreciated.

HM

On 20 Oct 2002 at 8:43, David M. Karr wrote:


"Howard" == Howard Miller <[EMAIL PROTECTED]> writes:



   Howard> Hi,
   Howard> Can somebody kindly help me with the following...

   Howard> I want to add a path and an Action class. The action class will then preload data into 
   Howard> a bean and then forward (do I mean forward) to the jsp that displays the bean. That's 
   Howard> it. I want this action to be in *addition* to the *normal* jsp/formbean/action setup.

   Howard> I can't see how to do it in particular

   Howard> 1. I don't think I fully understand how/why an action is associated with a bean in 
   Howard> struts-config. What does the action servlet do with this information.

   Howard> 2. How do I properly forward from an action to a jsp with the bean information intact. 
   Howard> It seems to be very similar to an action returning its "input form" to display errors, but 
   Howard> doing this doesn't work.  Whatever I do I seem to get a blank page.

In fact, the best practice is to always preface a page with an action.  You end
up with actions that prepare information for a page, and actions which process
information for a page.  The actions which process the page information will
always have had the form bean created before you get to the action.  However,
the actions which prepare the page information may have to manually create the
form bean and put it into the appropriate scope.

Note that the welcome page for an application would normally be something like
"index.jsp", which does nothing but forward to an action to start the
application.  You can't preface the welcome page with an action, but you can
make it do nothing but go to an action to prepare the real first page.

Look at the source code for the "example" application for some examples of
using the form bean.  The user guide also talks about the control flow with
respect to form beans.

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 






--
To unsubscribe, e-mail:   
For ad

[BOOK ANN] Struts: Practical Guide now available

2002-10-20 Thread Sue Spielman
Hi, Everyone:

I'm very pleased to announce that...

The Struts Framework: Practical Guide for Java Programmers (Morgan-Kaufmann) 
is now available.

The Struts Framework: Practical Guide for Java Programmers is written for 
Java programmers who need to understand, build, and deploy Struts 
applications. It provides the systematic exploration required by newcomers 
as well as the step-by-step instruction for more experienced readers eager 
to exploit Struts to the fullest. Devoted to the latest version of the 
framework (v1.1) and vividly illustrated with a thorough sample application 
throughout, this book is an essential resource for all programmers who want 
to be part of the next stage in the evolution of the web.

Features
• Hard-to-find, practical coverage from a highly visible figure in the Java 
development world.
• Reviews all the technologies comprising Struts, including JavaServer 
Pages, Servlets, XML, Custom Tags, and web and application servers.
• Teaches readers the development practices—including design, debugging, 
internationalization, and implementation—essential to Struts development.
· Provides downloadable sample code and data for use in a Struts-based 
database application via a companion web site.

What readers are saying:
I heartily endorse this book. Ever since an early copy of Sue's manuscript 
hit my desk, it has not left my side and is now well thumbed and gathering 
coffee stains from regular use.
—Simon Chappell, Java Programming Specialist with a Fortune 100 company

Sue Spielman launches the aspiring Java J2EE programmer on an exciting 
exploration of Struts-based MVC architecture and applies this knowledge in 
creating a state-of-the-art web application. No 21st Century web software 
engineering library is complete without this important book. 
—David McClure, Internet Technology Group, Fidelity Investments

I've used this book to jump start my Struts-based application development. I 
especially like the "Struts Development Cycle" that describes best practices 
for designing, implementing, and deploying a Struts project. This book has 
valuable insights that you won't find anywhere else.
—Tom Marrs, Senior Architect, Distributed Computing Solutions, Inc.


I hope this book is an asset to the Struts developer community and I'll look 
forward to hearing your feedback. You can order your copy at 
http://www.amazon.com/exec/obidos/ASIN/1558608621/switchbacksof-20

Regards,
Sue

President/Senior Consulting Engineer
Switchback Software LLC.
http://www.switchbacksoftware.com
Providing software development and consulting services for enterprise 
business, web, and wireless applications.

PH: 303.838.6643
FX: 303.838.6649




_
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: return false

2002-10-20 Thread Tuan H. Le
Hi David,

My bad and you saved my day! Thanks for your help!

Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 1:16 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> -Original Message-
Tuan> From: David M. Karr [mailto:dmkarr@;earthlink.net]
Tuan> Sent: Sunday, October 20, 2002 12:45 PM

> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan> ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );

Tuan> 
Tuan> 
Tuan> 
David> What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

Tuan> Hi David,
Tuan> Thanks for your response! 

Tuan> IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". 
I'm not sure that's the issue, because the session.getAttribute returned a correct 
ArrayList object employeeList and the for loop works fine.

Read the API documentation for the "present" tag.  You'll find it says this
about the "name" attribute:

  Checks for the existence of a JSP bean, in any scope, with the specified name.

That means the key for the object in the table has to have that name.  In your
"logic:present" tag, you've referenced the name "employeeList", but you put it
into the table with a name of "com.xyz.key.USER".

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: return false

2002-10-20 Thread Tuan H. Le
I even replaced the variable IConstants.USER_EMPLOYEE_LIST_KEY to the actual value 
"com.xyz.key.USER" in the session.getAttribute( ... ) method, but still have the same 
issue. Again, the for loop works just fine.

Thanks,
Tuan

-Original Message-
From: Tuan H. Le 
Sent: Sunday, October 20, 2002 12:50 PM
To: Struts Users Mailing List
Subject: RE:  return false


Hi David,

Thanks for your response! 

IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". I'm not 
sure that's the issue, because the session.getAttribute returned a correct ArrayList 
object employeeList and the for loop works fine.

Any ideas?

Thanks,
Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute before 
forwarding to a JSP view. But, the  in the JSP view always return false 
on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() + "");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: about images and db

2002-10-20 Thread Tero P Paananen
> What could you suggest to me to display images stored in a database.
> When I get them in a bean what could I do to show them on a web d. page?

How is this related to Struts?

Did you Google for answers before posting?

-TPP


<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: return false

2002-10-20 Thread Tuan H. Le
Hi David,

Thanks for your response! 

IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". I'm not 
sure that's the issue, because the session.getAttribute returned a correct ArrayList 
object employeeList and the for loop works fine.

Any ideas?

Thanks,
Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute before 
forwarding to a JSP view. But, the  in the JSP view always return false 
on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() + "");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Newbie Question

2002-10-20 Thread Todd Pierce
Sorry about the late reply. Mail problems.

I found http://jsptags.com/tags/navigation/pager/ to be a good start. It
needs a bit of tweaking if you're using global forwards or page templates...
but I'm not going to complain about free resources! 
; )

- Todd

-Original Message-
From: CJ Jayaprakash [mailto:cj.jayaprakash@;aspentech.com]
Sent: Friday, 18 October 2002 8:53 AM
To: 'Struts Users Mailing List'
Subject: RE: Newbie Question


Thanks for the reply !
well not at all ! 
But I am thinking about all that nice features like [ .net has concept
datagrid], sorting , paging
conditional display of columns [ not through SQl but at the display level],
conditional display of rows.
post backs after changing the cell value etc.

- CJ


-Original Message-
From: Eddie Bush [mailto:ekbush@;swbell.net]
Sent: Thursday, October 17, 2002 6:50 PM
To: Struts Users Mailing List
Subject: Re: Newbie Question


Nope.  It's not.  There are things which can be used on top of Struts 
for this though - at least, I believe there are.  It occurs to me I've 
seen a couple of posts about such a thing recently, but I can't remember 
it's name - and certainly can't speak to how effective it/they are.

Is it really that hard to iterate over a collection and build a table 
though?

CJ Jayaprakash wrote:

> 
>
>Let me start the Forum with a dump question[ Searched the Archives already]
>
>Tags for Grid/Table/Tree: is it part of the struts ?, any pointers ?
>
>- Cheers
>
>  CJ
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: return false

2002-10-20 Thread David M. Karr
> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute before 
forwarding to a JSP view. But, the  in the JSP view always return false 
on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() + "");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: i18n messages in javascript js file

2002-10-20 Thread James Mitchell
Have you taken a look at using the validator (its part of core struts now)?

By using this validation framework, you can add both client side and server
side validations to your web application.

You can get up to speed by reading the docs or (as I prefer) run the
struts-example and 'take a look under the hood'.


James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org




> -Original Message-
> From: sridhar [mailto:sridhard@;tatanova.com]
> Sent: Sunday, October 20, 2002 12:12 PM
> To: Struts Users Mailing List
> Cc: [EMAIL PROTECTED]
> Subject: Re: i18n messages in javascript js file
>
>
> Thanks James,
> That's how we had implemented for now, but is it right to have just
> javavascript code in a separate jsp and include it in all the other jsp's.
> is there any better solution ?
>
> sridhar
>
> - Original Message -
> From: "James Mitchell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Sunday, October 20, 2002 2:06 AM
> Subject: RE: i18n messages in javascript js file
>
>
> > Yes you can.
> >
> > Since you are using a .js file (client side include), if you prefer to
> have
> > the least amount of impact on your application, change it to a .jsp file
> and
> > add the necessary changes (adding bean:message for each i18n'd message)
> >
> > Is this enough info?
> >
> > If you need further assistance, submit a portion of your validation
> scripts
> > and I'll send you back a working example.
> >
> >
> > James Mitchell
> > Software Engineer/Struts Evangelist
> > http://www.open-tools.org
> >
> >
> >
> >
> > > -Original Message-
> > > From: sridhar [mailto:sridhard@;tatanova.com]
> > > Sent: Saturday, October 19, 2002 2:21 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: i18n messages in javascript js file
> > >
> > >
> > > My application uses javascript validations (at the client side)
> > > and all the validations are done in a validate.js file and
> > > displays the error messages with alerts. And all the messages in
> > > the javascript are hardcoded and the js file is used in many
> > > jsp's. Can i make the messages internationalized using struts
> > > frames work? if yes how can i do that ?
> > >
> > > thanks in advance.
> > > sridhar
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> >
>
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




return false

2002-10-20 Thread Tuan H. Le
Hi,

In my Action class I set an object in one of the session attribute before forwarding 
to a JSP view. But, the  in the JSP view always return false on that 
object.

Below is my code. Do you know what I'm missing? employeeList is an ArrayList object.

If I use a for loop below (see comment code block), then it finds the employeeList and 
return the right data from that array object.

Thanks,
Tuan

 My Action code ***

...
session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
// Forward to the appropriate View
return ( mapping.findForward( target ) );


* My JSP page *
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<%@ page import="java.util.ArrayList" %>
<%@ page import="com.phs.ezhr.business.vo.EmployeeVO" %>
<%@ page import="com.phs.ezhr.constant.IConstants" %>

<%
  ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );

  // *
  // THIS CODE WORK, BUT THE  does not work
  // *
  //for ( int i = 0; i < employeeList.size(); i++ ) {
  //  out.println( "i = " + i + "" );
  // EmployeeVO e = (EmployeeVO)employeeList.get( i );
  // out.println( "Employee ID --> " + e.getEmployeeId() + "");
  //}
%>





  
  






 




  
  
   
  














<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


Re: about images and db

2002-10-20 Thread Antoni Reus
Hi,

A Diumenge 20 Octubre 2002 17:09, Frederic Laub va escriure:
> Hi,
>
> I'm also interested in the two cases.
> The first case is clear to me, writing the byte data directly to out.
> The second case, I would appreciate if you could clarify. What do you mean
> by holding the content type in the bean.
> An example of the second option would be wonderful!
>

I mean creating a value object, something like an implementation of 
org.apache.struts.upload.FormFile

to hold the binary data, the content type ("image/png", "image/jpg"  ), 
etc ...

Then, the Action would call the business methods to get this value object and 
would save it in the request, and forward to a servlet that would retrieve 
the value object from the request, set the content type and write the data to 
the response.

This way you can reuse the servlet in case you have documents, like pdfs in 
your database as blobs or something.

Every time you need to stream a file, you only need to define an action that 
calls the business method to get the file value object and save it to the 
request.

In struts-config.xml you would have something like this:






   


and in web.xml

  
fileServlet
the.servlet.that.writes.the.Files
  

  
fileServlet
/fileServlet
  


Salut,

 --Antoni Reus

> Thanks in advance.
> Frederic
>
> -Original Message-
> From: Antoni Reus [mailto:antoni.reus@;wanadoo.es]
> Sent: 20 October 2002 16:12
> To: Struts Users Mailing List
> Subject: Re: about images and db
>
> A Diumenge 20 Octubre 2002 15:34, kiuma va escriure:
> > thx , for your reply but I meant if was possible something like
> >
> > 
> > ...
> > hello!
> > ..
> > 
> >
> > using only custom tags
>
> Then, the are 2 different requests, the one that returns the html and the
> one
> that returns the image (you can't include the image data in the html)
>
> In the html you could have:
>
> 
> ...
> hello!  
> ...
> 
>
> And  showImage.do  would be the Action that we talked about before.
>
> > Antoni Reus wrote:
> > >Hi,
> > >
> > >A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:
> > >>What could you suggest to me to display images stored in a database.
> > >>When I get them in a bean what could I do to show them on a web d.
> > >> page?
> > >
> > >You can:
> > >
> > >1. In a Action:
> > >   response.setContentType( "the type of the image" );
> > >   OutputStream out = response.getOutputStream();
> > >   ... write the data (byte array?) to out 
> > >   return null;
> > >
> > >2. Or you could save the bean representing the image (content type, and
> > > data) in the request and forward to a servlet, and write the data to
> > > the response in the servlet.
> > >
> > >
> > >--
> > >To unsubscribe, e-mail:
> > >  For additional
> > > commands, e-mail: 
> > >
> > >.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: PLEASE HELP - struts-tiles no longer work

2002-10-20 Thread Tuan H. Le
Micael,

Thanks for your help! I corrected my mistake by using the String equals() method, and 
it works fine.

Tuan

-Original Message-
From: micael [mailto:caraunltd@;harbornet.com]
Sent: Saturday, October 19, 2002 12:21 AM
To: Struts Users Mailing List
Subject: Re: PLEASE HELP - struts-tiles no longer work 


I don't know, but my guess is that you meant to use 
someString.equals(someOtherString) rather than someString == 
someOtherString, unless you somehow are using a hidden myString.intern() in 
there.  My guess, in other words, is that you are getting nothing because 
all your "==" tests yield false.  Try sticking a "!" or two in there and 
see if something miraculously appears.  Debuggers are not very clever at 
finding the real problems, like this one, if this is right.

At 12:03 AM 10/19/2002 -0700, you wrote:
>Why don't you look at the source?  My guess is that if you are looking at 
>a blank page, the page, except for tags, is blank.
>
>At 08:41 PM 10/18/2002 -0700, you wrote:
>>Hi,
>>
>>My app was working fine using struts-tiles with frameset. But since this 
>>afternoon, it does not work any more. It displays a blank page (NOT a 404 
>>error).
>>
>>I have tried with debug code, but couldn't figure out. The action forward 
>>seems to work fine after the user login. I tested and it forwarded to the 
>>right View (JSP) which is the MainMenu.jsp. I have been debugging this 
>>issue for the last 5 hrs, and I ran out of idea where to look for a 
>>solution to this problem.
>>
>>Please help!
>>
>>Thanks,
>>Tuan
>>
>>
>>** MainMenu.jsp ***
>>
>><%@ page import="com.phs.ezhr.constant.IConstants" %>
>>
>><%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>>
>><%
>> // get the user's selected navigation
>> String selTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_TAB_KEY );
>> String selSubTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_SUBTAB_KEY );
>>%>
>>
>><% if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) { %>
>>   
>><% }
>>
>>
>>** Layout.jsp 
>>
>><%@ page language="java" %>
>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>><%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
>><%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>>
>><%@ page import="com.phs.ezhr.constant.IConstants" %>
>><%
>> // get the user's selected navigation
>> String selTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_TAB_KEY );
>> String selSubTab = (String)session.getAttribute( 
>> IConstants.USER_SEL_SUBTAB_KEY );
>> // set the frameset row heights for each tab header
>> String rh1 = null;
>> String rh2 = "*";
>> String rh3 = null;
>> String cw1 = null;
>> String cw2 = "*";
>> if ( selTab == IConstants.MANAGER_SUMMARY_TAB ) {
>>   rh1 = "99";
>>   rh3 = "55";
>>   cw1 = "95%";
>> } else if ( selTab == IConstants.SALARY_TAB ) {
>>   rh1 = "201";
>>   rh3 = "125";
>>   cw1 = "97%";
>> } else if ( selTab == IConstants.BONUS_TAB ) {
>>   rh1 = "229";
>>   rh3 = "125";
>>   cw1 = "95%";
>> }
>>%>
>>
>>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>><%=request.getContextPath()%>
>>Select Tab = <%= selTab %>
>>
>>
>>
>>
>>' name="header" id="top" frameborder="0" scrolling="no" noresize 
>>marginwidth="0" marginheight="0" framespacing="0"> ' name="body" 
>>marginwidth="0" marginheight="0" scrolling="yes" frameborder="0" noresize 
>>framespacing="0"> ' name="rightSide" marginwidth="10" marginheight="10" 
>>scrolling="no" frameborder="0" noresize framespacing="0"> ' name="footer" 
>>id="bottom" frameborder="0" scrolling="no" marginwidth="0" 
>>marginheight="0" noresize framespacing="0"> *** 
>>tiles-definitions.xml * >version="1.0" encoding="ISO-8859-1" ?> -- To unsubscribe, e-mail: For 
>>additional commands, e-mail:
>
>Micael
>
>---
>
>This electronic mail  transmission and any accompanying documents contain 
>information belonging to the sender which may be confidential and legally 
>privileged.  This information is intended only for the use of the 
>individual or entity to whom this electronic mail transmission was sent as 
>indicated above. If you are not the intended recipient, any disclosure, 
>copying, distribution, or action taken in reliance on the contents of the 
>information contained in this transmission is strictly prohibited.  If you 
>have received this transmission in error, please delete the 
>message.  Thank you
>
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>

Micael


Re: return false

2002-10-20 Thread David M. Karr
> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> -Original Message-
Tuan> From: David M. Karr [mailto:dmkarr@;earthlink.net]
Tuan> Sent: Sunday, October 20, 2002 12:45 PM

> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan> ArrayList employeeList = (ArrayList)session.getAttribute( 
IConstants.USER_EMPLOYEE_LIST_KEY );

Tuan> 
Tuan> 
Tuan> 
David> What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

Tuan> Hi David,
Tuan> Thanks for your response! 

Tuan> IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER". 
I'm not sure that's the issue, because the session.getAttribute returned a correct 
ArrayList object employeeList and the for loop works fine.

Read the API documentation for the "present" tag.  You'll find it says this
about the "name" attribute:

  Checks for the existence of a JSP bean, in any scope, with the specified name.

That means the key for the object in the table has to have that name.  In your
"logic:present" tag, you've referenced the name "employeeList", but you put it
into the table with a name of "com.xyz.key.USER".

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: return false

2002-10-20 Thread Daniel Jaffa
A off hand response, try changing the scope of the object maybe to request
in both the action and the jsp page.  Also in the action try to put a name
like "nameOfObject" in

session.setAttribute("nameOfObject", employeeList );




- Original Message -
From: "Tuan H. Le" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, October 20, 2002 3:56 PM
Subject: RE:  return false


I even replaced the variable IConstants.USER_EMPLOYEE_LIST_KEY to the actual
value "com.xyz.key.USER" in the session.getAttribute( ... ) method, but
still have the same issue. Again, the for loop works just fine.

Thanks,
Tuan

-Original Message-
From: Tuan H. Le
Sent: Sunday, October 20, 2002 12:50 PM
To: Struts Users Mailing List
Subject: RE:  return false


Hi David,

Thanks for your response!

IConstants.USER_EMPLOYEE_LIST_KEY is a string of value "com.xyz.key.USER".
I'm not sure that's the issue, because the session.getAttribute returned a
correct ArrayList object employeeList and the for loop works fine.

Any ideas?

Thanks,
Tuan

-Original Message-
From: David M. Karr [mailto:dmkarr@;earthlink.net]
Sent: Sunday, October 20, 2002 12:45 PM
To: [EMAIL PROTECTED]
Subject: Re:  return false


> "Tuan" == Tuan H Le <[EMAIL PROTECTED]> writes:

Tuan> Hi,
Tuan> In my Action class I set an object in one of the session attribute
before forwarding to a JSP view. But, the  in the JSP view
always return false on that object.

Tuan>  My Action code ***

Tuan> ...
Tuan> session.setAttribute( USER_EMPLOYEE_LIST_KEY, employeeList );
Tuan> // Forward to the appropriate View
Tuan> return ( mapping.findForward( target ) );

Tuan> * My JSP page *
Tuan> <%
Tuan>   ArrayList employeeList = (ArrayList)session.getAttribute(
IConstants.USER_EMPLOYEE_LIST_KEY );
Tuan>   // *
Tuan>   // THIS CODE WORK, BUT THE  does not work
Tuan>   // *
Tuan>   //for ( int i = 0; i < employeeList.size(); i++ ) {
Tuan>   //  out.println( "i = " + i + "" );
Tuan>   // EmployeeVO e = (EmployeeVO)employeeList.get( i );
Tuan>   // out.println( "Employee ID --> " + e.getEmployeeId() +
"");
Tuan>   //}
Tuan> %>

Tuan> 
Tuan>   
Tuan>   
Tuan>
Tuan>   
Tuan> 

What is the value of "IConstants.USER_EMPLOYEE_LIST_KEY"?

--
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Tiles Idea

2002-10-20 Thread Dan Ritchey
I recently completed an addon to Struts/Tiles that allows to one determine
at runtime which tiles definition should be displayed based on the incoming
HttpServletRequest and the ServletContext.

I created a Struts PlugIn/RequestProcessor that descends from the Tiles
PlugIn/RequestProcessor and intercepts processForwardConfig calls so that I
can determine what path the request should actually be fowarded to based on
a view selection algorithm.

Below is an example of the XML config file (which is used in conjunction
with the tiles config file).







 




 










Everytime something is fowarded on, the foward path is checked to see if it
is equal dynamic view name, if it is the below algorithm is applied to
determine the path that the foward path maps to for this request.

for each view in dynamic view
 calculate selection score
 (foreach selector in a view's referenced selector set
  if the selector evaluates to true,
  then add 1 to the selection score.

  if the selector evaluates to false,
  then set the selection score to 0 and return.
  end
  return selection score)


 if selection score == 0,
 then continue

 if selection score > previous selection score score,
 then set current view as the selected view

 if selection score == previous selection score,
 then continue.
 end

 if selected view is not set,
 then set to default

When a Selector is evaluated it is passed the HttpServletRequest and
ServletContext.

So far its intended use will be for determing the view based on the user's
current role (like whether they are an admin or a regular user, etc), the
user's preferred language, and site branding and customization to the
clients liking.

I tried doing this with what is already provided with tiles (like using a
controller class for instance), but it didn't seem as powerful or
configurable as I needed it.

So anyway I was just wondering if any of you had any ideas or comments (good
or bad) about this approach, I would love to hear it.

thanks,
Dan Ritchey


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDK 1.4 and struts

2002-10-20 Thread Xue-Feng Yang
Forgot to mention that I use Sun Java 1.4.1.

 --- Xue-Feng Yang <[EMAIL PROTECTED]> wrote: 
> I tried Struts 1.1b2 with Tomcat 4.1.12 on win2k and
>Redhat 7.3. I haven't met any problem. 
> 
> I will try on Redhat 8.0 in next a few days.
> 
>  --- email <[EMAIL PROTECTED]> wrote: > 
> > There were a couple of messages the other day
> > concerning Struts failing
> > to work correctly under the 1.4 JDK. I'd like to
> add
> > some evidence to that.
> > 
> > Sun's 1.4 JDK (at least the Linux version) seems
> to
> > have serious
> > problems w/ the classpath. After upgrading to
> > 1.4.0_01, and then
> > 1.4.1_01, Struts no longer works on my machine.
> > Specifically, when
> > dispatching to an Action subclass, the JVM cannot
> > seem to find
> > org.apache.struts.action.Action -- despite knowing
> > all about
> > ActionServlet and a bunch of other classes in the
> > struts.jar file. 
> > 
> > Someone stated recentl 7y that Struts DOES WORK w/
> > JDK1.4. Which OS is
> > that? And does anyone have positive experience
> using
> > Struts w/ JDK1.4 on 
> > Linux?
> > 
> > ---
> > John Byrd
> > [EMAIL PROTECTED]
> > 
> > --
> > To unsubscribe, e-mail:  
> >
> 
> > For additional commands, e-mail:
> > 
> >  
> 
>
__
> 
> Post your free ad now! http://personals.yahoo.ca
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

__ 
Post your free ad now! http://personals.yahoo.ca

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Struts -> migrating to JSTL

2002-10-20 Thread flare
well.. I've read the specs and now I (strongly) want to use JSTL with struts 1.02 ;)
Any recommendation?
I'm going to use struts html + core + fmt jstl. The only problems I can think of is 
how to set 
the same resource bundle of struts in jstl and the i18n stuff (how can I switch locale 
in struts 
and make jstl know about that?) 
Is there a doc that explains how to migrate to JSTL?   

 thanx 

PS does JSTL support dynabeans?


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDK 1.4 and struts

2002-10-20 Thread Xue-Feng Yang
I tried Struts 1.1b2 with Tomcat 4.1.12 on win2k and
Redhat 7.3. I haven't met any problem. 

I will try on Redhat 8.0 in next a few days.

 --- email <[EMAIL PROTECTED]> wrote: > 
> There were a couple of messages the other day
> concerning Struts failing
> to work correctly under the 1.4 JDK. I'd like to add
> some evidence to that.
> 
> Sun's 1.4 JDK (at least the Linux version) seems to
> have serious
> problems w/ the classpath. After upgrading to
> 1.4.0_01, and then
> 1.4.1_01, Struts no longer works on my machine.
> Specifically, when
> dispatching to an Action subclass, the JVM cannot
> seem to find
> org.apache.struts.action.Action -- despite knowing
> all about
> ActionServlet and a bunch of other classes in the
> struts.jar file. 
> 
> Someone stated recentl 7y that Struts DOES WORK w/
> JDK1.4. Which OS is
> that? And does anyone have positive experience using
> Struts w/ JDK1.4 on 
> Linux?
> 
> ---
> John Byrd
> [EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
>  

__ 
Post your free ad now! http://personals.yahoo.ca

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: i18n messages in javascript js file

2002-10-20 Thread sridhar
Thanks James,
That's how we had implemented for now, but is it right to have just
javavascript code in a separate jsp and include it in all the other jsp's.
is there any better solution ?

sridhar

- Original Message -
From: "James Mitchell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, October 20, 2002 2:06 AM
Subject: RE: i18n messages in javascript js file


> Yes you can.
>
> Since you are using a .js file (client side include), if you prefer to
have
> the least amount of impact on your application, change it to a .jsp file
and
> add the necessary changes (adding bean:message for each i18n'd message)
>
> Is this enough info?
>
> If you need further assistance, submit a portion of your validation
scripts
> and I'll send you back a working example.
>
>
> James Mitchell
> Software Engineer/Struts Evangelist
> http://www.open-tools.org
>
>
>
>
> > -Original Message-
> > From: sridhar [mailto:sridhard@;tatanova.com]
> > Sent: Saturday, October 19, 2002 2:21 PM
> > To: [EMAIL PROTECTED]
> > Subject: i18n messages in javascript js file
> >
> >
> > My application uses javascript validations (at the client side)
> > and all the validations are done in a validate.js file and
> > displays the error messages with alerts. And all the messages in
> > the javascript are hardcoded and the js file is used in many
> > jsp's. Can i make the messages internationalized using struts
> > frames work? if yes how can i do that ?
> >
> > thanks in advance.
> > sridhar
> >
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDK 1.4 and struts

2002-10-20 Thread Melissa L Kelley


I've started using Struts 1.1 on Linux (Redhat 7.2) using Tomcat 4.1.12
with Sun's JDK 1.4.1. So far, I haven't run into any problems, but I have
only been working on it for a couple of days. And the struts-example.war
deployed like a champ. This is with one of the more recent nightly builds
of Struts. That being said, I'm off to go find some wood. I've got some
knocking to do.


On Sat, 19 Oct 2002, email(I believe that would be John) wrote:

>
> Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is
> that? And does anyone have positive experience using Struts w/ JDK1.4 on
> Linux?
>



--> stu: www.stuology.net
It just no longer is plain simple safe fun
when it's the psycho chimp that has the ray gun

Stuology -- A million monkeys can't be wrong




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to add a pre-action

2002-10-20 Thread Howard Miller
I think I'm seriously missing the point here! I have looked at the example application 
in some detail and it appears to add a parameter (eg, ?action=new) to tell the action 
for a form to perform an initialising action. I don't see it using a "pre-" action.

I am incredibly stuck with the concept of how to code an action that is not 
encumbered with *special* parameters to pre-load the bean data. My particular 
problem is that I have pages where the previous page cannot be predicted, so the jsp 
must have a means of loading its own data.

I would really appreciated some pointers as to how to set this up. *** I particularly 
don't understand how to get the action to call the following JSP *** (ie, I would 
really 
appreciate some specific - example - help on this!! ). At least every method I have 
tried doesn't work.

I do understand how to actually create a bean manually and put in in the scope. I 
don't understand how to set up a generic preload action for a given JSP/ActionForm, 
and what the config should look like.

Again, any help much appreciated.

HM

On 20 Oct 2002 at 8:43, David M. Karr wrote:

> > "Howard" == Howard Miller <[EMAIL PROTECTED]> writes:
> 
> Howard> Hi,
> Howard> Can somebody kindly help me with the following...
> 
> Howard> I want to add a path and an Action class. The action class will then 
>preload data into 
> Howard> a bean and then forward (do I mean forward) to the jsp that displays the 
>bean. That's 
> Howard> it. I want this action to be in *addition* to the *normal* 
>jsp/formbean/action setup.
> 
> Howard> I can't see how to do it in particular
> 
> Howard> 1. I don't think I fully understand how/why an action is associated with 
>a bean in 
> Howard> struts-config. What does the action servlet do with this information.
> 
> Howard> 2. How do I properly forward from an action to a jsp with the bean 
>information intact. 
> Howard> It seems to be very similar to an action returning its "input form" to 
>display errors, but 
> Howard> doing this doesn't work.  Whatever I do I seem to get a blank page.
> 
> In fact, the best practice is to always preface a page with an action.  You end
> up with actions that prepare information for a page, and actions which process
> information for a page.  The actions which process the page information will
> always have had the form bean created before you get to the action.  However,
> the actions which prepare the page information may have to manually create the
> form bean and put it into the appropriate scope.
> 
> Note that the welcome page for an application would normally be something like
> "index.jsp", which does nothing but forward to an action to start the
> application.  You can't preface the welcome page with an action, but you can
> make it do nothing but go to an action to prepare the real first page.
> 
> Look at the source code for the "example" application for some examples of
> using the form bean.  The user guide also talks about the control flow with
> respect to form beans.
> 
> -- 
> ===
> David M. Karr  ; Java/J2EE/XML/Unix/C++
> [EMAIL PROTECTED]
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 
> 
> 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to add a pre-action

2002-10-20 Thread David M. Karr
> "Howard" == Howard Miller <[EMAIL PROTECTED]> writes:

Howard> Hi,
Howard> Can somebody kindly help me with the following...

Howard> I want to add a path and an Action class. The action class will then 
preload data into 
Howard> a bean and then forward (do I mean forward) to the jsp that displays the 
bean. That's 
Howard> it. I want this action to be in *addition* to the *normal* 
jsp/formbean/action setup.

Howard> I can't see how to do it in particular

Howard> 1. I don't think I fully understand how/why an action is associated with a 
bean in 
Howard> struts-config. What does the action servlet do with this information.

Howard> 2. How do I properly forward from an action to a jsp with the bean 
information intact. 
Howard> It seems to be very similar to an action returning its "input form" to 
display errors, but 
Howard> doing this doesn't work.  Whatever I do I seem to get a blank page.

In fact, the best practice is to always preface a page with an action.  You end
up with actions that prepare information for a page, and actions which process
information for a page.  The actions which process the page information will
always have had the form bean created before you get to the action.  However,
the actions which prepare the page information may have to manually create the
form bean and put it into the appropriate scope.

Note that the welcome page for an application would normally be something like
"index.jsp", which does nothing but forward to an action to start the
application.  You can't preface the welcome page with an action, but you can
make it do nothing but go to an action to prepare the real first page.

Look at the source code for the "example" application for some examples of
using the form bean.  The user guide also talks about the control flow with
respect to form beans.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDK 1.4 and struts

2002-10-20 Thread flare
> 
> Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is
> that? And does anyone have positive experience using Struts w/ JDK1.4
> on Linux?
 
me, Sun JDK1.4.1 (I usually prefere the Blackdown one but it is still beta), Linux  
TSL 
Kernel 2.2.22,  Resin 2.1.5, Struts 1.02 (I haven't tried the 1.1). I've just switched 
the JDK 
and everything worked, just got annoying warnings that cannot be redirected during the 
compilation of jsp pages

  

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts -> migrating to JSTL

2002-10-20 Thread David M. Karr
> "flare" == flare  <[EMAIL PROTECTED]> writes:

flare> well.. I've read the specs and now I (strongly) want to use JSTL with 
struts 1.02 ;)
flare> Any recommendation?
flare> I'm going to use struts html + core + fmt jstl. The only problems I can 
think of is how to set 
flare> the same resource bundle of struts in jstl and the i18n stuff (how can I 
switch locale in struts 
flare> and make jstl know about that?) 
flare> Is there a doc that explains how to migrate to JSTL?   

You want to use the OLD Struts with the NEW JSTL?  (Not that there was an "old"
JSTL.)

You will definitely find it much easier to use the NEW Struts.  In particular,
the nightly build.  That's because, in the nightly build, one of the
contributed libraries is called "Struts-EL".  If you've read the JSTL
specification, you probably can guess what that implies.

That being said, there's no technical reason you couldn't use Struts 1.02 with
the JSTL.  You'd just have to know that the JSTL uses scoped variables, but
Struts will require scriptlet variables in some places.  If you used Struts-EL,
you don't need scriptlet variables.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




best praktice: preview of a form

2002-10-20 Thread rainer juenger
Hi,

I am thinking of a concept how to best realize a WYSIWYIG preview of filed
in form values.

what's the job?
after a struts-from was validated and everything is filled in okay I want to
preview the values in a JSP-Site that shows the just filed in values for
final verification by the User.
If the entered values are okay a further action can be processed (eg.
persistence)
If not the entered values shoud be edited in the input-form.

I tried many ways but all of them do cause certain problems.
What is the most struts conform solution to this problem?

thanks Rainer



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: about images and db

2002-10-20 Thread kiuma
thx , for your reply but I meant if was possible something like


...
hello!
..


using only custom tags


Antoni Reus wrote:


Hi,

A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:


What could you suggest to me to display images stored in a database.
When I get them in a bean what could I do to show them on a web d. page?



You can:

1. In a Action:
	response.setContentType( "the type of the image" );
	OutputStream out = response.getOutputStream();
	... write the data (byte array?) to out 
	return null;

2. Or you could save the bean representing the image (content type, and data) 
in the request and forward to a servlet, and write the data to the response 
in the servlet.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




about images and db

2002-10-20 Thread kiuma
What could you suggest to me to display images stored in a database.
When I get them in a bean what could I do to show them on a web d. page?


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: about images and db

2002-10-20 Thread Frederic Laub
Hi,

I'm also interested in the two cases.
The first case is clear to me, writing the byte data directly to out.
The second case, I would appreciate if you could clarify. What do you mean
by holding the content type in the bean.
An example of the second option would be wonderful!

Thanks in advance.
Frederic

-Original Message-
From: Antoni Reus [mailto:antoni.reus@;wanadoo.es]
Sent: 20 October 2002 16:12
To: Struts Users Mailing List
Subject: Re: about images and db


A Diumenge 20 Octubre 2002 15:34, kiuma va escriure:
> thx , for your reply but I meant if was possible something like
>
> 
> ...
> hello!
> ..
> 
>
> using only custom tags
>

Then, the are 2 different requests, the one that returns the html and the
one
that returns the image (you can't include the image data in the html)

In the html you could have:


...
hello!  
...


And  showImage.do  would be the Action that we talked about before.



> Antoni Reus wrote:
> >Hi,
> >
> >A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:
> >>What could you suggest to me to display images stored in a database.
> >>When I get them in a bean what could I do to show them on a web d. page?
> >
> >You can:
> >
> >1. In a Action:
> > response.setContentType( "the type of the image" );
> > OutputStream out = response.getOutputStream();
> > ... write the data (byte array?) to out 
> > return null;
> >
> >2. Or you could save the bean representing the image (content type, and
> > data) in the request and forward to a servlet, and write the data to the
> > response in the servlet.
> >
> >
> >--
> >To unsubscribe, e-mail:
> >  For additional
> > commands, e-mail: 
> >
> >.


--
To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




A better practice: environment entry vs. initialization parameter?

2002-10-20 Thread Vernon Wu


A few of email addresses needed to be accessed from time to time in my current 
project. They can be definited either as 
initialization parameters or environment entries. I can see some pros and cons of 
those two implementations. Do 
someone have  some experience with those two implementation for a heavy loaded 
application?

Thanks for sharing your informaiton.

Vernon



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: about images and db

2002-10-20 Thread Antoni Reus
Hi,

A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:
> What could you suggest to me to display images stored in a database.
> When I get them in a bean what could I do to show them on a web d. page?

You can:

1. In a Action:
response.setContentType( "the type of the image" );
OutputStream out = response.getOutputStream();
... write the data (byte array?) to out 
return null;

2. Or you could save the bean representing the image (content type, and data) 
in the request and forward to a servlet, and write the data to the response 
in the servlet.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: about images and db

2002-10-20 Thread kiuma
Thanks a lot!

Antoni Reus wrote:


A Diumenge 20 Octubre 2002 15:34, kiuma va escriure:


thx , for your reply but I meant if was possible something like


...
hello!
..


using only custom tags



Then, the are 2 different requests, the one that returns the html and the one 
that returns the image (you can't include the image data in the html)

In the html you could have:


...
hello!  
...


And  showImage.do  would be the Action that we talked about before.



Antoni Reus wrote:


Hi,

A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:


What could you suggest to me to display images stored in a database.
When I get them in a bean what could I do to show them on a web d. page?


You can:

1. In a Action:
	response.setContentType( "the type of the image" );
	OutputStream out = response.getOutputStream();
	... write the data (byte array?) to out 
	return null;

2. Or you could save the bean representing the image (content type, and
data) in the request and forward to a servlet, and write the data to the
response in the servlet.


--
To unsubscribe, e-mail:  
 For additional
commands, e-mail: 

.



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 

.





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDK 1.4 and struts

2002-10-20 Thread John Byrd
Well, I tried this on a whim, and it WORKED:

I expanded the struts.jar file in the WEB-INF/classes directory. I
believe there is an issue w/r/t resolving classpaths either in Sun's
JDK1.4 or in Tomcat 4.1.x, or possibly both.



> Problem is, IBM doesn't HAVE a 1.4 for Intel machines.
> 
> 
> > Struts works under Sun's 1.4 jdk on Windows 2000.  I haven't tried
it on 
> > Linux though.  You might try using IBM's 1.4 jdk.
> > 
> > David
> > 
> > 
> > 
> > 
> > 
> > 
> > >From: "email" <[EMAIL PROTECTED]>
> > >Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > >To: [EMAIL PROTECTED]
> > >Subject: JDK 1.4 and struts
> > >Date: Sat, 19 Oct 2002 20:21:23 -0400
> > >
> > >
> > >There were a couple of messages the other day concerning Struts failing
> > >to work correctly under the 1.4 JDK. I'd like to add some evidence to
> that.
> > >
> > >Sun's 1.4 JDK (at least the Linux version) seems to have serious
> > >problems w/ the classpath. After upgrading to 1.4.0_01, and then
> > >1.4.1_01, Struts no longer works on my machine. Specifically, when
> > >dispatching to an Action subclass, the JVM cannot seem to find
> > >org.apache.struts.action.Action -- despite knowing all about
> > >ActionServlet and a bunch of other classes in the struts.jar file.
> > >
> > >Someone stated recently that Struts DOES WORK w/ JDK1.4. Which OS is
> > >that? And does anyone have positive experience using Struts w/
JDK1.4 on
> > >Linux?
> > >
> > >---
> > >John Byrd
> > >[EMAIL PROTECTED]
> > >
> > >--
> > >To unsubscribe, e-mail:   
> > >
> > >For additional commands, e-mail: 
> > >
> > 
> > 
> > _
> > Unlimited Internet access for only $21.95/month.  Try MSN! 
> > http://resourcecenter.msn.com/access/plans/2monthsfree.asp
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> > 
> > 
> 
> -- 
> John Byrd
> [EMAIL PROTECTED]
> 
> --
> To unsubscribe, e-mail:  

> For additional commands, e-mail:

> 
> 

-- 
John Byrd
[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to add a pre-action

2002-10-20 Thread Howard Miller
Hi,

Can somebody kindly help me with the following...

I want to add a path and an Action class. The action class will then preload data into 
a bean and then forward (do I mean forward) to the jsp that displays the bean. That's 
it. I want this action to be in *addition* to the *normal* jsp/formbean/action setup.

I can't see how to do it in particular

1. I don't think I fully understand how/why an action is associated with a bean in 
struts-config. What does the action servlet do with this information.

2. How do I properly forward from an action to a jsp with the bean information intact. 
It seems to be very similar to an action returning its "input form" to display errors, 
but 
doing this doesn't work.  Whatever I do I seem to get a blank page.

Any help very much appreciated.

Howard Miller

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: about images and db

2002-10-20 Thread Antoni Reus
A Diumenge 20 Octubre 2002 15:34, kiuma va escriure:
> thx , for your reply but I meant if was possible something like
>
> 
> ...
> hello!
> ..
> 
>
> using only custom tags
>

Then, the are 2 different requests, the one that returns the html and the one 
that returns the image (you can't include the image data in the html)

In the html you could have:


...
hello!  
...


And  showImage.do  would be the Action that we talked about before.



> Antoni Reus wrote:
> >Hi,
> >
> >A Diumenge 20 Octubre 2002 11:47, kiuma va escriure:
> >>What could you suggest to me to display images stored in a database.
> >>When I get them in a bean what could I do to show them on a web d. page?
> >
> >You can:
> >
> >1. In a Action:
> > response.setContentType( "the type of the image" );
> > OutputStream out = response.getOutputStream();
> > ... write the data (byte array?) to out 
> > return null;
> >
> >2. Or you could save the bean representing the image (content type, and
> > data) in the request and forward to a servlet, and write the data to the
> > response in the servlet.
> >
> >
> >--
> >To unsubscribe, e-mail:  
> >  For additional
> > commands, e-mail: 
> >
> >.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: