Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread nitin dubey
Hi Jack,

I have been thinking of posting the same problem but
was watching this thread to arrive at something that
would help me..

Anyways, as you mentioned in this reply that it can be
done using single Action, I am into the same.

I want to populate the form using dispatch action. 
All the things are in place in the framework I am
trying to build for one of the project.  But somehow I
could not digest the idea of having 2 actions to
populate the form and do some action.  I would like it
to be a Single Action using DispatchAction so that all
the code related to the single form is kept at one
place and is not scattered across the forms.

Plz reply back its urgent.

Regards,


Nitin Dubey



--- Dakota Jack <[EMAIL PROTECTED]> wrote:
> No problem, Nic.  Just trying to see what the
> problem is.  Glad I
> asked.  I would not have know this was it.  So, your
> client on a
> browser is seeing a list of users, chooses a user,
> then has that users
> attributes displayed and can update them.  Right? 
> If so, this is
> easy.
> 
> You can use one JSP page or two for this.  Either
> way it does not
> matter.  I would use one, but you look like you
> would use two.  Let's
> do that:  Let's also use two Actions --
> GetUserAction and
> UpldateUserAction, although I would only use one and
> would use
> DispatchAction in some way.  But, only use one
> ActionForm -- UserForm
> -- which will have a field for identifying the user,
> e.g. id, and
> fields for the values your user has, e.g. name,
> soc_sec_no, etc. 
> Select a user from the first JSP page and call
> GetUserAction.  If
> successful, the GetUserAction will process the
> action by getting the
> User and populating the user's fields in the
> UserForm, and returning
> an ActionForward to the second page, where the form
> values will be
> displayed.  It is that simple.
> 
> 
> On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner
> <[EMAIL PROTECTED]> wrote:
> > I apologize as I seem to have hijacked this thread
> in a direction I
> > didn't intend. Jack, I didn't mean for you to pick
> through my code, it
> > was just in response to Joe helping me.
> > 
> > To answer your question Dakota Jack, in an overall
> view what you have
> > said is correct:
> > 
> >  From a page of Users, I want to click on one to
> open a JSP page that I
> > can 'Edit' the User attributes, and then have that
> individual
> > attribute data 'Updated'. It really is very
> simple.
> > 
> > Reading the replies here and the Struts FAQ,
> everyone says "Create two
> > actions, one to pre-populate the data, and the
> other to save that data"
> > - So, the first action populates the data in the
> Execute() function,
> > returns an ActionForward to the 'Edit' JSP. But in
> order for html:form
> > to display that populated data, I have to refer to
> the first Action, not
> > the second, barring me from submitting this data
> to the second page.
> > 
> > I've got to have this wrong! I've re-read these
> responses and pored
> > through my Struts book but I'm obviously missing
> something
> > 
> > Thanks everyone for your input, I only post to the
> list when I'm truly
> > stumped.
> > 
> > - Nic.
> > 
> > Dakota Jack wrote:
> > 
> > >I am just going to hold out, Nic, until you
> merely say what you want
> > >the client to do without giving any code.  If you
> want to know what to
> > >do from me, just tell me what you want the client
> to do.  As I said,
> > >this is simple stuff, but dealing with your code
> just complicates it.
> > >
> > >If you don't just want to define what the client
> wants to see and do,
> > >that is okay.  That is your choice.  But I am not
> digging through what
> > >you are doing to answer a simple question.
> > >
> > >Maybe I can do it for you and you can just
> confirm:
> > >
> > >You want to have a page with values in a form
> call an action to "edit"
> > >using the values and then to return to some page
> that will have these
> > >values displayed and the page will be used by the
> client to "update"
> > >the data?  Is that right?  This does not make
> sense to me but seems to
> > >be what you want the client to do.  Please just
> state what you want
> > >the client to do and only that, okay?  You are
> really over
> > >complicating everything, I think.
> > >
> > >Jack
> > >
> > >
> > >
> > >
> > 
> > 
> 
> 
> -- 
> "You can lead a horse to water but you cannot make
> it float on its back."
> ~Dakota Jack~
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 



__ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

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



Load message resources from DB???

2005-03-14 Thread Jason Long
Is it possible to load the message resources from a database instead of a
file?  If so can this be done without reloading the entire application?  I
would like to let users manage these.

Thank you for your time, 

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com



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



Load message resources from DB???

2005-03-14 Thread Jason Long
Is it possible to load the message resources from a database instead of a
file?  If so can this be done without reloading the entire application?  I
would like to let users manage these.

Thank you for your time, 

Jason Long
CEO and Chief Software Engineer
BS Physics, MS Chemical Engineering
http://www.supernovasoftware.com



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



RE: Struts Menu

2005-03-14 Thread Vijaya S
Hi Matt,

Thanks very much for the reply. I use struts-menu version 2.3.
My menu-config.xml is




  

  

  
  

   
   

  



The jsp where the menu is incorporated looks like
<%@ taglib uri="http://struts-menu.sf.net/tag"; prefix="menu" %>

  


struts-config has the plugin added as
  

  

Am I doing anything else wrong?

Vijaya

-Original Message-
From: Matt Raible [mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 7:32 PM
To: Struts Users Mailing List
Subject: Re: Struts Menu



On Mar 14, 2005, at 5:31 AM, Antony Joseph wrote:

> Hi Vijaya,
> You will need an entry in the web.xml similar to the one below:
>   
> /WEB-INF/struts-menu
> /WEB-INF/struts-menu.tld
>   

You should only need this if the URI in your JSP taglib declaration
points to the URI in your web.xml.  2.3 Servlet containers will scan
JARs and pick up the URIs from there.

Can you post your displayer mappings (from the top of menu-config.xml)
and the struts-menu part of your JSP?

Also, what version of Struts Menu are you using?

Matt

>
> If you are still having problems, check out the application
> https://workeffort.dev.java.net . It uses struts-menu.
>
> - Original Message -
> From: "Vijaya S" <[EMAIL PROTECTED]>
> To: "Struts User mailing List" 
> Subject: Struts Menu
> Date: Mon, 14 Mar 2005 10:47:58 +0530
>
>>
>> Hi,
>>
>> Has anyone successfully implemented Struts Menu in your application?
>> I am
>> getting an error as
>> 'The displayer mapping for the specified MenuDisplayer does not
>> exist'.
>>
>> I have done the following
>> 1. In my struts-config I have included the plugin
>> 2. I have placed my menu-config.xml under WEB-INF.
>> 3. My jsp has the corresponding taglibs included
>> 4. struts-menu jar is placed under the lib directory of my
>> application.
>>
>> Am I missing anything else? I posted my problem in struts-menu user
>> list but
>> no replies. If anyone of you is successful with struts-menu, can you
>> please
>> tell me what I am doing wrong?
>>
>> Thanks,
>> Vijaya
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> Antony Joseph
> http://www.logicden.com
> https://workeffort.dev.java.net
>
> --
> ___
> NEW! Lycos Dating Search. The only place to search multiple dating
> sites at once.
> http://datingsearch.lycos.com
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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






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



RE: Tiles does not function in case validation error?

2005-03-14 Thread David G. Friedman
Daniel,

Why aren't you doing one of the following:

1. set your input from "/ChgPassword.jsp" to the tile "user.chgPassword".

2. change validate="true" to validate="false" then perform the validation
call in your Action whenever you need it.  That way, you'll know when
validation fails and can send the visitor to the "failure" mapping instead
of using the action's "input" attribute.

Regards,
David

-Original Message-
From: Daniel PC Leung [mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 8:52 AM
To: Struts Users Mailing List
Subject: Tiles does not function in case validation error?


In case validation error, the header, footer and menu portions
disappear when error messages display on top of the body page which
occupies the whole screen.

If I can click "cancel" or validation is okay, Tiles function
properly. Only the body page is changed.



  
  
  



Anything I can change?

thanks

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


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



Re: Correct Prepopulate Method (simple problem) SOLVED.

2005-03-14 Thread Nic Werner
Okay, after some review of my code and such, it is now working! There is 
not one definite thing, I just double-checked everything I had after 
taking a break.

I want to thank everyone for their input (and patience) and the side 
emails making sure I was up and running. This is a great community, and 
even though I'd much rather lurk, the support is great.

   As Jack suggested, I will move to DispatchActions now, a lot of the 
work up until now was a proof of concept for Struts/iBATIS to see how 
they handled CRUD operations. I'm converted.

- Nic.
Dakota Jack wrote:
Note that the key is not to think of the ActionForm as somehow being
wedded to the page form.  That is a crazy way to think.  ///;-)
On Mon, 14 Mar 2005 12:43:18 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote:
 

No problem, Nic.  Just trying to see what the problem is.  Glad I
asked.  I would not have know this was it.  So, your client on a
browser is seeing a list of users, chooses a user, then has that users
attributes displayed and can update them.  Right?  If so, this is
easy.
You can use one JSP page or two for this.  Either way it does not
matter.  I would use one, but you look like you would use two.  Let's
do that:  Let's also use two Actions -- GetUserAction and
UpldateUserAction, although I would only use one and would use
DispatchAction in some way.  But, only use one ActionForm -- UserForm
-- which will have a field for identifying the user, e.g. id, and
fields for the values your user has, e.g. name, soc_sec_no, etc.
Select a user from the first JSP page and call GetUserAction.  If
successful, the GetUserAction will process the action by getting the
User and populating the user's fields in the UserForm, and returning
an ActionForward to the second page, where the form values will be
displayed.  It is that simple.
On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <[EMAIL PROTECTED]> wrote:
   

I apologize as I seem to have hijacked this thread in a direction I
didn't intend. Jack, I didn't mean for you to pick through my code, it
was just in response to Joe helping me.
To answer your question Dakota Jack, in an overall view what you have
said is correct:
From a page of Users, I want to click on one to open a JSP page that I
can 'Edit' the User attributes, and then have that individual
attribute data 'Updated'. It really is very simple.
Reading the replies here and the Struts FAQ, everyone says "Create two
actions, one to pre-populate the data, and the other to save that data"
- So, the first action populates the data in the Execute() function,
returns an ActionForward to the 'Edit' JSP. But in order for html:form
to display that populated data, I have to refer to the first Action, not
the second, barring me from submitting this data to the second page.
I've got to have this wrong! I've re-read these responses and pored
through my Struts book but I'm obviously missing something
Thanks everyone for your input, I only post to the list when I'm truly
stumped.
- Nic.
Dakota Jack wrote:
 

I am just going to hold out, Nic, until you merely say what you want
the client to do without giving any code.  If you want to know what to
do from me, just tell me what you want the client to do.  As I said,
this is simple stuff, but dealing with your code just complicates it.
If you don't just want to define what the client wants to see and do,
that is okay.  That is your choice.  But I am not digging through what
you are doing to answer a simple question.
Maybe I can do it for you and you can just confirm:
You want to have a page with values in a form call an action to "edit"
using the values and then to return to some page that will have these
values displayed and the page will be used by the client to "update"
the data?  Is that right?  This does not make sense to me but seems to
be what you want the client to do.  Please just state what you want
the client to do and only that, okay?  You are really over
complicating everything, I think.
Jack

   

 

--
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~
   


 


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


Re: Typical Struts development team and distribution of tasks?

2005-03-14 Thread Craig McClanahan
On Fri, 11 Mar 2005 13:06:38 -0500, Ted Husted <[EMAIL PROTECTED]> wrote:
> I still see both. The larger team, the more likely it is that people
> start to specialized. But it is not unusual to see teams where
> everyone can do everything, from code HTML to code Java to code SQL.
> 
> -Ted.

Ted's experience mirrors what I see in Struts-based apps in general,
but with *lots* of variation in how big the team is before roles
become specialized.  To some degree, that in turn depends on whether
the project team is itself part of a larger organization that has
skill specialists available that can work part time on multiple
projects, versus a relatively smaller organization that asks their
developers to wear multiple hats.

The nice thing about a framework like Struts is that it can accomodate
any of these working styles fairly gracefully.

Craig

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



Re: STRUTS PROJECT finding problem

2005-03-14 Thread Martin Gainty
Erik-
I didnt get the attachment please resend
M-
- Original Message - 
From: "Eric Lemle" <[EMAIL PROTECTED]>
To: 
Sent: Monday, March 14, 2005 5:24 PM
Subject: STRUTS PROJECT finding problem


What could cause this error
See attached error message.
Why can't it find the site?
-Eric




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


Re: Using javascript to access nested form items

2005-03-14 Thread Frank W. Zammetti
That's what I thought, but I wasn't certain so I didn't say it.  Both IE 
and Firefox handled it, at least to the extent that the fields of the 
inner form weren't lost or hidden or anything.  I suppose that's a 
*form* of support :)

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
Neil Erdwien wrote:
HTML doesn't support nested forms.  In other words,
   
  
 
  
   
is invalid HTML.  The browsers likely just ignore the second FORM tag 
and treat it as one big form.  But there no guarantees of that behavior.

Frank W. Zammetti wrote:
At least in IE:
projectForm.estStaffCost.value
...will get the value of the textfield.  In fact, looking in the DOM 
inspector in Firefox, it is true there too.  Seems "nested forms" is a 
bit of a misnomer... seems the elements of the second form show up in 
the object tree of the first.



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


Re: Using javascript to access nested form items

2005-03-14 Thread Hubert Rabago
or try something like:

document.projectForm["projectStobsForms[1].estStaffCost"].value

where "projectStobsForms[1].estStaffCost" matches what struts uses for
the field names in the form controls.

Hubert


On Mon, 14 Mar 2005 17:45:33 -0500, Frank W. Zammetti
<[EMAIL PROTECTED]> wrote:
> At least in IE:
> 
> projectForm.estStaffCost.value
> 
> ...will get the value of the textfield.  In fact, looking in the DOM
> inspector in Firefox, it is true there too.  Seems "nested forms" is a
> bit of a misnomer... seems the elements of the second form show up in
> the object tree of the first.
> 
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> 
> jelything wrote:
> > I have a struts 1.1 form with a nested form.  I need to access
> > textareas with javascript, but am not hitting the right syntax.  Can
> > anyone help me out?
> >
> > The main form is 'projectForm'.
> > The nested form is 'projectStobsForms'.
> > The textfield I'm trying to read/write is 'estStaffCost'.
> >
> > I've tried:
> >
> > window.opener.document.projectForm.projectStobsForms[1].estStaffCost.value
> >
> > and
> >
> > window.opener.document.projectForm.elements[projectStobsForms[1].estStaffCost].value
> >
> > And neither works.  Any suggestions are, as always, much appreciated.
> >
> > J
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> > .
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Using javascript to access nested form items

2005-03-14 Thread Neil Erdwien
HTML doesn't support nested forms.  In other words,
   
  
 
  
   
is invalid HTML.  The browsers likely just ignore the second FORM tag 
and treat it as one big form.  But there no guarantees of that behavior.

Frank W. Zammetti wrote:
At least in IE:
projectForm.estStaffCost.value
...will get the value of the textfield.  In fact, looking in the DOM 
inspector in Firefox, it is true there too.  Seems "nested forms" is a 
bit of a misnomer... seems the elements of the second form show up in 
the object tree of the first.

--
Neil Erdwien, [EMAIL PROTECTED], Web Technologies Manager
Computing and Network Services, Kansas State University
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Using javascript to access nested form items

2005-03-14 Thread Frank W. Zammetti
At least in IE:
projectForm.estStaffCost.value
...will get the value of the textfield.  In fact, looking in the DOM 
inspector in Firefox, it is true there too.  Seems "nested forms" is a 
bit of a misnomer... seems the elements of the second form show up in 
the object tree of the first.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
jelything wrote:
I have a struts 1.1 form with a nested form.  I need to access
textareas with javascript, but am not hitting the right syntax.  Can
anyone help me out?
The main form is 'projectForm'.  
The nested form is 'projectStobsForms'.
The textfield I'm trying to read/write is 'estStaffCost'.

I've tried:
window.opener.document.projectForm.projectStobsForms[1].estStaffCost.value
and
window.opener.document.projectForm.elements[projectStobsForms[1].estStaffCost].value
And neither works.  Any suggestions are, as always, much appreciated.
J

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

.


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


STRUTS PROJECT finding problem (adding attachment again, not sure why it said Part.001)

2005-03-14 Thread Eric Lemle


>>> [EMAIL PROTECTED] 03/14/05 3:24 PM >>>
What could cause this error

See attached error message.


Why can't it find the site?


-Eric


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

Using javascript to access nested form items

2005-03-14 Thread jelything

I have a struts 1.1 form with a nested form.  I need to access
textareas with javascript, but am not hitting the right syntax.  Can
anyone help me out?

The main form is 'projectForm'.  
The nested form is 'projectStobsForms'.
The textfield I'm trying to read/write is 'estStaffCost'.

I've tried:

window.opener.document.projectForm.projectStobsForms[1].estStaffCost.value

and

window.opener.document.projectForm.elements[projectStobsForms[1].estStaffCost].value

And neither works.  Any suggestions are, as always, much appreciated.

J




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



STRUTS PROJECT finding problem

2005-03-14 Thread Eric Lemle
What could cause this error

See attached error message.


Why can't it find the site?


-Eric

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

Re: Output PDF

2005-03-14 Thread Andre Van Klaveren
Sounds like in 6.0 they went back to sending two extra requests
instead of one extra.  I'm assuming this from your statement.  I
haven't verified this with our application.  The first request (the
one generated by the user to get the PDF) should still have a valid
userAgent (MSIE).  The subsequent requests should have the "conType"
userAgent.  Can you verify this?

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 13:21:25 -0800, Scott Piker <[EMAIL PROTECTED]> wrote:
> This intrigued me, since our app also has some generated PDFs.  Sure
> enough, there's a double-get occurring w/ our IE clients (IE 6.0).
> 
> Problem is that the "USER_AGENT" header for get #1 & #2 are identical.
> In fact, the only difference I can see in all headers is that get #1 has
> an "ACCEPT-LANGUAGE" header, whereas get #2 does not.  Everything else
> is the same
> 
> So what gives?  Did MS "fix" the wrong end of this bug in IE6?  Is it
> safe to just look for the existence of the "ACCEPT-LANGUAGE" header?
> 
> Thanks,
> - Scott
> 
> 
> -Original Message-
> From: Andre Van Klaveren [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 14, 2005 3:39 PM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: Output PDF
> 
> I'm assuming that your browser client is IE.  If so, the reason your
> Action is being called twice is because of a "feature" in IE 4.x+.  If
> your application returns data that is to be handled with an ActiveX
> control (ie Adobe Acrobat Reader) the browser sends additional requests
> to the server.  In IE 4.x and 5 it actually sends three requests.  For
> IE 5.5+ it sends two.
> 
> Assuming that your using IE 5.5+, the first request is the original
> request (duh), but then IE sends a second request to get the
> content-type.  Who knows why they can't figure this out on the first
> request ;)  This second request has it's userAgent header set to
> "contype".  You can solve this problem and increase the performance of
> your application by writing a Servlet filter that sits in front of
> whatever Actions you have setup to serve PDF content.  Have this filter
> look at the userAgent header of each request.  If it's set to "contype"
> just send an an empty response back to the client with the content type
> set to "application/pdf".  Simple as that.
> 
> Now, the reason your getting an exception in the second code snippet you
> provided is because after you do your forward the JSP calls
> response.getOutputStream().  This is done behind the scenes but you can
> see it if you look at your generated Servlet code.  This method can only
> be called once during the lifestyle of the request, hence your
> exception.
> 
> It's generally a bad idea to have a JSP produce binary content anyway.
>  They were designed for Text or HTML output.
> 
> I wrote a generic/reusable Servlet whose sole purpose in life is to
> write binary content back to a client.  I called it BinaryOutputServlet.
> You put your binary data (byte[]) and the content type of the data in
> the request scope and forward to it.  It gets the data and content type
> out of the request and writes it back to the client.  It can be used for
> any type of data this way.  I would recommend doing something similar
> since Actions are really for control.  By writing back to the client
> from an Action you are violating the MVC model anyway.
> 
> I hope this helps.  Oh, and you can read all about the "feature" of IE
> here:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
> 
> Virtually,
> Andre Van Klaveren, SCP
> 
> On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]>
> wrote:
> > I'm using Jasper to create PDF's through my Actions and cannot figure
> > out a good way to export the resulting byte[] to the user.
> >
> > Currently the tail end of my Action class looks like this:
> >
> > byte[] reportBytes = null;
> >
> > File jasperReport = new File(location);
> >
> > try {
> >
> > reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> > parameters, dataSource);
> >
> > log.info("Found : " + reportBytes.length);
> >
> > } catch (JRException e) {
> >
> > e.printStackTrace();
> >
> > }
> >
> > response.setContentType("application/pdf");
> >
> > response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> > return(null);
> >
> > This will display the pdf, but the action class itself somehow get
> > called a second time as the above log statement is displayed twice.
> >
> > I also tried to set the byte[] on the request and forward onto another
> 
> > page which does:
> >
> >   <%
> >
> > byte[] reportBytes =
> > (byte[])request.getAttribute("REPORT_BYTES");
> >
> >   response.setContentType("application/pdf");
> >
> >   response.setContentLength(reportBytes.length);
> >
> > ServletOutp

RE: Output PDF

2005-03-14 Thread Scott Piker
This intrigued me, since our app also has some generated PDFs.  Sure
enough, there's a double-get occurring w/ our IE clients (IE 6.0).  

Problem is that the "USER_AGENT" header for get #1 & #2 are identical.
In fact, the only difference I can see in all headers is that get #1 has
an "ACCEPT-LANGUAGE" header, whereas get #2 does not.  Everything else
is the same

So what gives?  Did MS "fix" the wrong end of this bug in IE6?  Is it
safe to just look for the existence of the "ACCEPT-LANGUAGE" header?

Thanks,
- Scott


-Original Message-
From: Andre Van Klaveren [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 14, 2005 3:39 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Output PDF

I'm assuming that your browser client is IE.  If so, the reason your
Action is being called twice is because of a "feature" in IE 4.x+.  If
your application returns data that is to be handled with an ActiveX
control (ie Adobe Acrobat Reader) the browser sends additional requests
to the server.  In IE 4.x and 5 it actually sends three requests.  For
IE 5.5+ it sends two.

Assuming that your using IE 5.5+, the first request is the original
request (duh), but then IE sends a second request to get the
content-type.  Who knows why they can't figure this out on the first
request ;)  This second request has it's userAgent header set to
"contype".  You can solve this problem and increase the performance of
your application by writing a Servlet filter that sits in front of
whatever Actions you have setup to serve PDF content.  Have this filter
look at the userAgent header of each request.  If it's set to "contype"
just send an an empty response back to the client with the content type
set to "application/pdf".  Simple as that.

Now, the reason your getting an exception in the second code snippet you
provided is because after you do your forward the JSP calls
response.getOutputStream().  This is done behind the scenes but you can
see it if you look at your generated Servlet code.  This method can only
be called once during the lifestyle of the request, hence your
exception.

It's generally a bad idea to have a JSP produce binary content anyway.
 They were designed for Text or HTML output.

I wrote a generic/reusable Servlet whose sole purpose in life is to
write binary content back to a client.  I called it BinaryOutputServlet.
You put your binary data (byte[]) and the content type of the data in
the request scope and forward to it.  It gets the data and content type
out of the request and writes it back to the client.  It can be used for
any type of data this way.  I would recommend doing something similar
since Actions are really for control.  By writing back to the client
from an Action you are violating the MVC model anyway.

I hope this helps.  Oh, and you can read all about the "feature" of IE
here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]>
wrote:
> I'm using Jasper to create PDF's through my Actions and cannot figure 
> out a good way to export the resulting byte[] to the user.
> 
> Currently the tail end of my Action class looks like this:
> 
> byte[] reportBytes = null;
> 
> File jasperReport = new File(location);
> 
> try {
> 
> reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> parameters, dataSource);
> 
> log.info("Found : " + reportBytes.length);
> 
> } catch (JRException e) {
> 
> e.printStackTrace();
> 
> }
> 
> response.setContentType("application/pdf");
> 
> response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
> return(null);
> 
> This will display the pdf, but the action class itself somehow get 
> called a second time as the above log statement is displayed twice.
> 
> I also tried to set the byte[] on the request and forward onto another

> page which does:
> 
>   <%
> 
> byte[] reportBytes =
> (byte[])request.getAttribute("REPORT_BYTES");
> 
>   response.setContentType("application/pdf");
> 
>   response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = 
> response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
>   %>
> 
> But this complains about: getOutputStream() has already been called 
> for this response
> 
> Any ideas?
> 
> 


--
Virtually,
Andre Van Klaveren
SCP

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


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

Re: Output PDF

2005-03-14 Thread Andre Van Klaveren
Any time!


Virtually,
Andre Van Klaveren, SCP

On Mon, 14 Mar 2005 14:51:37 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> Thanks for the great response.  This should take care of all my issues.
> 
> -Original Message-
> From: Andre Van Klaveren [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 14, 2005 2:39 PM
> To: Struts Users Mailing List; [EMAIL PROTECTED]
> Subject: Re: Output PDF
> 
> I'm assuming that your browser client is IE.  If so, the reason your
> Action is being called twice is because of a "feature" in IE 4.x+.  If
> your application returns data that is to be handled with an ActiveX
> control (ie Adobe Acrobat Reader) the browser sends additional
> requests to the server.  In IE 4.x and 5 it actually sends three
> requests.  For IE 5.5+ it sends two.
> 
> Assuming that your using IE 5.5+, the first request is the original
> request (duh), but then IE sends a second request to get the
> content-type.  Who knows why they can't figure this out on the first
> request ;)  This second request has it's userAgent header set to
> "contype".  You can solve this problem and increase the performance of
> your application by writing a Servlet filter that sits in front of
> whatever Actions you have setup to serve PDF content.  Have this
> filter look at the userAgent header of each request.  If it's set to
> "contype" just send an an empty response back to the client with the
> content type set to "application/pdf".  Simple as that.
> 
> Now, the reason your getting an exception in the second code snippet
> you provided is because after you do your forward the JSP calls
> response.getOutputStream().  This is done behind the scenes but you
> can see it if you look at your generated Servlet code.  This method
> can only be called once during the lifestyle of the request, hence
> your exception.
> 
> It's generally a bad idea to have a JSP produce binary content anyway.
>  They were designed for Text or HTML output.
> 
> I wrote a generic/reusable Servlet whose sole purpose in life is to
> write binary content back to a client.  I called it
> BinaryOutputServlet.  You put your binary data (byte[]) and the
> content type of the data in the request scope and forward to it.  It
> gets the data and content type out of the request and writes it back
> to the client.  It can be used for any type of data this way.  I would
> recommend doing something similar since Actions are really for
> control.  By writing back to the client from an Action you are
> violating the MVC model anyway.
> 
> I hope this helps.  Oh, and you can read all about the "feature" of IE here:
> http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792
> 
> Virtually,
> Andre Van Klaveren, SCP
> 
> On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> > I'm using Jasper to create PDF's through my Actions and cannot figure out
> a
> > good way to export the resulting byte[] to the user.
> >
> > Currently the tail end of my Action class looks like this:
> >
> > byte[] reportBytes = null;
> >
> > File jasperReport = new File(location);
> >
> > try {
> >
> > reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> > parameters, dataSource);
> >
> > log.info("Found : " + reportBytes.length);
> >
> > } catch (JRException e) {
> >
> > e.printStackTrace();
> >
> > }
> >
> > response.setContentType("application/pdf");
> >
> > response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> > return(null);
> >
> > This will display the pdf, but the action class itself somehow get called
> a
> > second time as the above log statement is displayed twice.
> >
> > I also tried to set the byte[] on the request and forward onto another
> page
> > which does:
> >
> >   <%
> >
> > byte[] reportBytes =
> > (byte[])request.getAttribute("REPORT_BYTES");
> >
> >   response.setContentType("application/pdf");
> >
> >   response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> >   %>
> >
> > But this complains about: getOutputStream() has already been called for
> this
> > response
> >
> > Any ideas?
> >
> >
> 
> --
> Virtually,
> Andre Van Klaveren
> SCP
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Virtually,
Andre Van Klaveren
SCP

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



Re: Output PDF

2005-03-14 Thread Andre Van Klaveren
Woh!  IE *does not* use the URL to determine content type.  It's
determined by the MIME type sent back with the response from the
server.

And, by default, the option to have IE save encrypted data to disk is
turned on, so there won't be an issue with PDFs and SSL unless
Micro$oft has changed this is XPSP2.  I'm running XPSP2 at home and
have no problem viewing PDFs over an encrypted connection.  Micro$oft
would be breaking a lot of clients if they chose to change that
setting.

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 13:43:51 -0700, Larry Meadors
<[EMAIL PROTECTED]> wrote:
> Why are you doing that in a jsp? You can do it in an action, but it
> will not work that well (but it will work better tahn in a jsp, i
> promise).
> 
> The other issue is that a URL ending in /foo.do?name=value will not be
> seen by IE as a pdf. You should probably use a servlet for this
> instead, then you can map the URL like the one above as this:
> /foo/name/value/file.pdf, that will trick the browser into thinking
> that it is just a static file.
> 
> Another problem you will have is that if you are using ssl, IE will
> not allow acrobat to read from the cache. Your users will have to hack
> the registry to make it work.
> 
> Larry
> 
> 
> On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> > I'm using Jasper to create PDF's through my Actions and cannot figure out a
> > good way to export the resulting byte[] to the user.
> >
> > Currently the tail end of my Action class looks like this:
> >
> > byte[] reportBytes = null;
> >
> > File jasperReport = new File(location);
> >
> > try {
> >
> > reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> > parameters, dataSource);
> >
> > log.info("Found : " + reportBytes.length);
> >
> > } catch (JRException e) {
> >
> > e.printStackTrace();
> >
> > }
> >
> > response.setContentType("application/pdf");
> >
> > response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> > return(null);
> >
> > This will display the pdf, but the action class itself somehow get called a
> > second time as the above log statement is displayed twice.
> >
> > I also tried to set the byte[] on the request and forward onto another page
> > which does:
> >
> >   <%
> >
> > byte[] reportBytes =
> > (byte[])request.getAttribute("REPORT_BYTES");
> >
> >   response.setContentType("application/pdf");
> >
> >   response.setContentLength(reportBytes.length);
> >
> > ServletOutputStream ouputStream = response.getOutputStream();
> >
> > ouputStream.write(reportBytes, 0, reportBytes.length);
> >
> > ouputStream.flush();
> >
> > ouputStream.close();
> >
> >   %>
> >
> > But this complains about: getOutputStream() has already been called for this
> > response
> >
> > Any ideas?
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
Virtually,
Andre Van Klaveren
SCP

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



RE: Output PDF

2005-03-14 Thread Brad Balmer
Thanks for the great response.  This should take care of all my issues.

-Original Message-
From: Andre Van Klaveren [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 14, 2005 2:39 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: Output PDF

I'm assuming that your browser client is IE.  If so, the reason your
Action is being called twice is because of a "feature" in IE 4.x+.  If
your application returns data that is to be handled with an ActiveX
control (ie Adobe Acrobat Reader) the browser sends additional
requests to the server.  In IE 4.x and 5 it actually sends three
requests.  For IE 5.5+ it sends two.

Assuming that your using IE 5.5+, the first request is the original
request (duh), but then IE sends a second request to get the
content-type.  Who knows why they can't figure this out on the first
request ;)  This second request has it's userAgent header set to
"contype".  You can solve this problem and increase the performance of
your application by writing a Servlet filter that sits in front of
whatever Actions you have setup to serve PDF content.  Have this
filter look at the userAgent header of each request.  If it's set to
"contype" just send an an empty response back to the client with the
content type set to "application/pdf".  Simple as that.

Now, the reason your getting an exception in the second code snippet
you provided is because after you do your forward the JSP calls
response.getOutputStream().  This is done behind the scenes but you
can see it if you look at your generated Servlet code.  This method
can only be called once during the lifestyle of the request, hence
your exception.

It's generally a bad idea to have a JSP produce binary content anyway.
 They were designed for Text or HTML output.

I wrote a generic/reusable Servlet whose sole purpose in life is to
write binary content back to a client.  I called it
BinaryOutputServlet.  You put your binary data (byte[]) and the
content type of the data in the request scope and forward to it.  It
gets the data and content type out of the request and writes it back
to the client.  It can be used for any type of data this way.  I would
recommend doing something similar since Actions are really for
control.  By writing back to the client from an Action you are
violating the MVC model anyway.

I hope this helps.  Oh, and you can read all about the "feature" of IE here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> I'm using Jasper to create PDF's through my Actions and cannot figure out
a
> good way to export the resulting byte[] to the user.
> 
> Currently the tail end of my Action class looks like this:
> 
> byte[] reportBytes = null;
> 
> File jasperReport = new File(location);
> 
> try {
> 
> reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> parameters, dataSource);
> 
> log.info("Found : " + reportBytes.length);
> 
> } catch (JRException e) {
> 
> e.printStackTrace();
> 
> }
> 
> response.setContentType("application/pdf");
> 
> response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
> return(null);
> 
> This will display the pdf, but the action class itself somehow get called
a
> second time as the above log statement is displayed twice.
> 
> I also tried to set the byte[] on the request and forward onto another
page
> which does:
> 
>   <%
> 
> byte[] reportBytes =
> (byte[])request.getAttribute("REPORT_BYTES");
> 
>   response.setContentType("application/pdf");
> 
>   response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
>   %>
> 
> But this complains about: getOutputStream() has already been called for
this
> response
> 
> Any ideas?
> 
> 


-- 
Virtually,
Andre Van Klaveren
SCP


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



Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Dakota Jack
Note that the key is not to think of the ActionForm as somehow being
wedded to the page form.  That is a crazy way to think.  ///;-)


On Mon, 14 Mar 2005 12:43:18 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote:
> No problem, Nic.  Just trying to see what the problem is.  Glad I
> asked.  I would not have know this was it.  So, your client on a
> browser is seeing a list of users, chooses a user, then has that users
> attributes displayed and can update them.  Right?  If so, this is
> easy.
> 
> You can use one JSP page or two for this.  Either way it does not
> matter.  I would use one, but you look like you would use two.  Let's
> do that:  Let's also use two Actions -- GetUserAction and
> UpldateUserAction, although I would only use one and would use
> DispatchAction in some way.  But, only use one ActionForm -- UserForm
> -- which will have a field for identifying the user, e.g. id, and
> fields for the values your user has, e.g. name, soc_sec_no, etc.
> Select a user from the first JSP page and call GetUserAction.  If
> successful, the GetUserAction will process the action by getting the
> User and populating the user's fields in the UserForm, and returning
> an ActionForward to the second page, where the form values will be
> displayed.  It is that simple.
> 
> 
> On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <[EMAIL PROTECTED]> wrote:
> > I apologize as I seem to have hijacked this thread in a direction I
> > didn't intend. Jack, I didn't mean for you to pick through my code, it
> > was just in response to Joe helping me.
> >
> > To answer your question Dakota Jack, in an overall view what you have
> > said is correct:
> >
> >  From a page of Users, I want to click on one to open a JSP page that I
> > can 'Edit' the User attributes, and then have that individual
> > attribute data 'Updated'. It really is very simple.
> >
> > Reading the replies here and the Struts FAQ, everyone says "Create two
> > actions, one to pre-populate the data, and the other to save that data"
> > - So, the first action populates the data in the Execute() function,
> > returns an ActionForward to the 'Edit' JSP. But in order for html:form
> > to display that populated data, I have to refer to the first Action, not
> > the second, barring me from submitting this data to the second page.
> >
> > I've got to have this wrong! I've re-read these responses and pored
> > through my Struts book but I'm obviously missing something
> >
> > Thanks everyone for your input, I only post to the list when I'm truly
> > stumped.
> >
> > - Nic.
> >
> > Dakota Jack wrote:
> >
> > >I am just going to hold out, Nic, until you merely say what you want
> > >the client to do without giving any code.  If you want to know what to
> > >do from me, just tell me what you want the client to do.  As I said,
> > >this is simple stuff, but dealing with your code just complicates it.
> > >
> > >If you don't just want to define what the client wants to see and do,
> > >that is okay.  That is your choice.  But I am not digging through what
> > >you are doing to answer a simple question.
> > >
> > >Maybe I can do it for you and you can just confirm:
> > >
> > >You want to have a page with values in a form call an action to "edit"
> > >using the values and then to return to some page that will have these
> > >values displayed and the page will be used by the client to "update"
> > >the data?  Is that right?  This does not make sense to me but seems to
> > >be what you want the client to do.  Please just state what you want
> > >the client to do and only that, okay?  You are really over
> > >complicating everything, I think.
> > >
> > >Jack
> > >
> > >
> > >
> > >
> >
> >
> 
> --
> "You can lead a horse to water but you cannot make it float on its back."
> ~Dakota Jack~
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Output PDF

2005-03-14 Thread Larry Meadors
Why are you doing that in a jsp? You can do it in an action, but it
will not work that well (but it will work better tahn in a jsp, i
promise).

The other issue is that a URL ending in /foo.do?name=value will not be
seen by IE as a pdf. You should probably use a servlet for this
instead, then you can map the URL like the one above as this:
/foo/name/value/file.pdf, that will trick the browser into thinking
that it is just a static file.

Another problem you will have is that if you are using ssl, IE will
not allow acrobat to read from the cache. Your users will have to hack
the registry to make it work.

Larry


On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> I'm using Jasper to create PDF's through my Actions and cannot figure out a
> good way to export the resulting byte[] to the user.
> 
> Currently the tail end of my Action class looks like this:
> 
> byte[] reportBytes = null;
> 
> File jasperReport = new File(location);
> 
> try {
> 
> reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> parameters, dataSource);
> 
> log.info("Found : " + reportBytes.length);
> 
> } catch (JRException e) {
> 
> e.printStackTrace();
> 
> }
> 
> response.setContentType("application/pdf");
> 
> response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
> return(null);
> 
> This will display the pdf, but the action class itself somehow get called a
> second time as the above log statement is displayed twice.
> 
> I also tried to set the byte[] on the request and forward onto another page
> which does:
> 
>   <%
> 
> byte[] reportBytes =
> (byte[])request.getAttribute("REPORT_BYTES");
> 
>   response.setContentType("application/pdf");
> 
>   response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
>   %>
> 
> But this complains about: getOutputStream() has already been called for this
> response
> 
> Any ideas?
> 
>

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



Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Dakota Jack
No problem, Nic.  Just trying to see what the problem is.  Glad I
asked.  I would not have know this was it.  So, your client on a
browser is seeing a list of users, chooses a user, then has that users
attributes displayed and can update them.  Right?  If so, this is
easy.

You can use one JSP page or two for this.  Either way it does not
matter.  I would use one, but you look like you would use two.  Let's
do that:  Let's also use two Actions -- GetUserAction and
UpldateUserAction, although I would only use one and would use
DispatchAction in some way.  But, only use one ActionForm -- UserForm
-- which will have a field for identifying the user, e.g. id, and
fields for the values your user has, e.g. name, soc_sec_no, etc. 
Select a user from the first JSP page and call GetUserAction.  If
successful, the GetUserAction will process the action by getting the
User and populating the user's fields in the UserForm, and returning
an ActionForward to the second page, where the form values will be
displayed.  It is that simple.


On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <[EMAIL PROTECTED]> wrote:
> I apologize as I seem to have hijacked this thread in a direction I
> didn't intend. Jack, I didn't mean for you to pick through my code, it
> was just in response to Joe helping me.
> 
> To answer your question Dakota Jack, in an overall view what you have
> said is correct:
> 
>  From a page of Users, I want to click on one to open a JSP page that I
> can 'Edit' the User attributes, and then have that individual
> attribute data 'Updated'. It really is very simple.
> 
> Reading the replies here and the Struts FAQ, everyone says "Create two
> actions, one to pre-populate the data, and the other to save that data"
> - So, the first action populates the data in the Execute() function,
> returns an ActionForward to the 'Edit' JSP. But in order for html:form
> to display that populated data, I have to refer to the first Action, not
> the second, barring me from submitting this data to the second page.
> 
> I've got to have this wrong! I've re-read these responses and pored
> through my Struts book but I'm obviously missing something
> 
> Thanks everyone for your input, I only post to the list when I'm truly
> stumped.
> 
> - Nic.
> 
> Dakota Jack wrote:
> 
> >I am just going to hold out, Nic, until you merely say what you want
> >the client to do without giving any code.  If you want to know what to
> >do from me, just tell me what you want the client to do.  As I said,
> >this is simple stuff, but dealing with your code just complicates it.
> >
> >If you don't just want to define what the client wants to see and do,
> >that is okay.  That is your choice.  But I am not digging through what
> >you are doing to answer a simple question.
> >
> >Maybe I can do it for you and you can just confirm:
> >
> >You want to have a page with values in a form call an action to "edit"
> >using the values and then to return to some page that will have these
> >values displayed and the page will be used by the client to "update"
> >the data?  Is that right?  This does not make sense to me but seems to
> >be what you want the client to do.  Please just state what you want
> >the client to do and only that, okay?  You are really over
> >complicating everything, I think.
> >
> >Jack
> >
> >
> >
> >
> 
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Output PDF

2005-03-14 Thread Andre Van Klaveren
I'm assuming that your browser client is IE.  If so, the reason your
Action is being called twice is because of a "feature" in IE 4.x+.  If
your application returns data that is to be handled with an ActiveX
control (ie Adobe Acrobat Reader) the browser sends additional
requests to the server.  In IE 4.x and 5 it actually sends three
requests.  For IE 5.5+ it sends two.

Assuming that your using IE 5.5+, the first request is the original
request (duh), but then IE sends a second request to get the
content-type.  Who knows why they can't figure this out on the first
request ;)  This second request has it's userAgent header set to
"contype".  You can solve this problem and increase the performance of
your application by writing a Servlet filter that sits in front of
whatever Actions you have setup to serve PDF content.  Have this
filter look at the userAgent header of each request.  If it's set to
"contype" just send an an empty response back to the client with the
content type set to "application/pdf".  Simple as that.

Now, the reason your getting an exception in the second code snippet
you provided is because after you do your forward the JSP calls
response.getOutputStream().  This is done behind the scenes but you
can see it if you look at your generated Servlet code.  This method
can only be called once during the lifestyle of the request, hence
your exception.

It's generally a bad idea to have a JSP produce binary content anyway.
 They were designed for Text or HTML output.

I wrote a generic/reusable Servlet whose sole purpose in life is to
write binary content back to a client.  I called it
BinaryOutputServlet.  You put your binary data (byte[]) and the
content type of the data in the request scope and forward to it.  It
gets the data and content type out of the request and writes it back
to the client.  It can be used for any type of data this way.  I would
recommend doing something similar since Actions are really for
control.  By writing back to the client from an Action you are
violating the MVC model anyway.

I hope this helps.  Oh, and you can read all about the "feature" of IE here:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q293792

Virtually,
Andre Van Klaveren, SCP


On Mon, 14 Mar 2005 14:01:48 -0600, Brad Balmer <[EMAIL PROTECTED]> wrote:
> I'm using Jasper to create PDF's through my Actions and cannot figure out a
> good way to export the resulting byte[] to the user.
> 
> Currently the tail end of my Action class looks like this:
> 
> byte[] reportBytes = null;
> 
> File jasperReport = new File(location);
> 
> try {
> 
> reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
> parameters, dataSource);
> 
> log.info("Found : " + reportBytes.length);
> 
> } catch (JRException e) {
> 
> e.printStackTrace();
> 
> }
> 
> response.setContentType("application/pdf");
> 
> response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
> return(null);
> 
> This will display the pdf, but the action class itself somehow get called a
> second time as the above log statement is displayed twice.
> 
> I also tried to set the byte[] on the request and forward onto another page
> which does:
> 
>   <%
> 
> byte[] reportBytes =
> (byte[])request.getAttribute("REPORT_BYTES");
> 
>   response.setContentType("application/pdf");
> 
>   response.setContentLength(reportBytes.length);
> 
> ServletOutputStream ouputStream = response.getOutputStream();
> 
> ouputStream.write(reportBytes, 0, reportBytes.length);
> 
> ouputStream.flush();
> 
> ouputStream.close();
> 
>   %>
> 
> But this complains about: getOutputStream() has already been called for this
> response
> 
> Any ideas?
> 
> 


-- 
Virtually,
Andre Van Klaveren
SCP

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



Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Jeff Beal
On Mon, 14 Mar 2005 11:53:12 -0800, Nic Werner <[EMAIL PROTECTED]> wrote:
> Reading the replies here and the Struts FAQ, everyone says "Create two
> actions, one to pre-populate the data, and the other to save that data"
> - So, the first action populates the data in the Execute() function,
> returns an ActionForward to the 'Edit' JSP. But in order for html:form
> to display that populated data, I have to refer to the first Action, not
> the second, barring me from submitting this data to the second page.

If both the "pre-populate" action and the "update" action have a
reference to the same ActionForm, you should be good to go.  (Just be
sure to set validate="false" on the "pre-populate" action.)

Here's the sequence of events:

1) The Struts RequestProcessor receives a request that it maps to prepopulate.do
2) It sees that prepopulate.do requires a "YourFormBean" object in
request scope, so it checks the request.
3) Since at this point, there is none, it creates a new instance of
the appropriate ActionForm subclass and saves it in the request
4) Your prepopulate action is called.  Since YourFormBean exists, all
you have to do is copy the appropriate properties from your model
layer into that object.
5) The prepopulate action returns a "success" forward, which points to
editYourFormBean.jsp
6) This JSP page has an  tag that points to update.do. 
The form tag class consults the configuration classes and sees that
the form for that action is also of type "YourFormBean".  Since this
form bean already exists, the form fields are populated with those
values.

Does that help?

-- Jeff

-- 
Jeff Beal
Webmedx, Inc.
Pittsburgh, PA USA

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



Output PDF

2005-03-14 Thread Brad Balmer
I'm using Jasper to create PDF's through my Actions and cannot figure out a
good way to export the resulting byte[] to the user.

 

Currently the tail end of my Action class looks like this:

 

byte[] reportBytes = null;

File jasperReport = new File(location);

try {

reportBytes = JasperRunManager.runReportToPdf(jasperReport.getPath(),
parameters, dataSource);

log.info("Found : " + reportBytes.length);

} catch (JRException e) {

e.printStackTrace();

}



response.setContentType("application/pdf");

response.setContentLength(reportBytes.length);

  

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(reportBytes, 0, reportBytes.length);

ouputStream.flush();

ouputStream.close();

 

return(null);

 

This will display the pdf, but the action class itself somehow get called a
second time as the above log statement is displayed twice.

 

I also tried to set the byte[] on the request and forward onto another page
which does:

  <%

byte[] reportBytes =
(byte[])request.getAttribute("REPORT_BYTES");

  response.setContentType("application/pdf");

  response.setContentLength(reportBytes.length);

  

ServletOutputStream ouputStream = response.getOutputStream();

ouputStream.write(reportBytes, 0, reportBytes.length);

ouputStream.flush();

ouputStream.close();

  %>

 

But this complains about: getOutputStream() has already been called for this
response

 

Any ideas?



Re: Correct Prepopulate Method (simple problem)

2005-03-14 Thread Nic Werner
I apologize as I seem to have hijacked this thread in a direction I 
didn't intend. Jack, I didn't mean for you to pick through my code, it 
was just in response to Joe helping me.

To answer your question Dakota Jack, in an overall view what you have 
said is correct:

From a page of Users, I want to click on one to open a JSP page that I 
can 'Edit' the User attributes, and then have that individual
attribute data 'Updated'. It really is very simple.

Reading the replies here and the Struts FAQ, everyone says "Create two 
actions, one to pre-populate the data, and the other to save that data"
- So, the first action populates the data in the Execute() function, 
returns an ActionForward to the 'Edit' JSP. But in order for html:form 
to display that populated data, I have to refer to the first Action, not 
the second, barring me from submitting this data to the second page.

I've got to have this wrong! I've re-read these responses and pored 
through my Struts book but I'm obviously missing something

Thanks everyone for your input, I only post to the list when I'm truly 
stumped.

- Nic.
Dakota Jack wrote:
I am just going to hold out, Nic, until you merely say what you want
the client to do without giving any code.  If you want to know what to
do from me, just tell me what you want the client to do.  As I said,
this is simple stuff, but dealing with your code just complicates it.
If you don't just want to define what the client wants to see and do,
that is okay.  That is your choice.  But I am not digging through what
you are doing to answer a simple question.
Maybe I can do it for you and you can just confirm:
You want to have a page with values in a form call an action to "edit"
using the values and then to return to some page that will have these
values displayed and the page will be used by the client to "update"
the data?  Is that right?  This does not make sense to me but seems to
be what you want the client to do.  Please just state what you want
the client to do and only that, okay?  You are really over
complicating everything, I think.
Jack
 


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


Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
I am just going to hold out, Nic, until you merely say what you want
the client to do without giving any code.  If you want to know what to
do from me, just tell me what you want the client to do.  As I said,
this is simple stuff, but dealing with your code just complicates it.

If you don't just want to define what the client wants to see and do,
that is okay.  That is your choice.  But I am not digging through what
you are doing to answer a simple question.

Maybe I can do it for you and you can just confirm:

You want to have a page with values in a form call an action to "edit"
using the values and then to return to some page that will have these
values displayed and the page will be used by the client to "update"
the data?  Is that right?  This does not make sense to me but seems to
be what you want the client to do.  Please just state what you want
the client to do and only that, okay?  You are really over
complicating everything, I think.

Jack


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: RE: Struts - Page Centric Framework[Scanned]

2005-03-14 Thread Ted Husted
In Struts, the Front Controller and Dispatcher are combined. Which
begs the quesion:

Do you actually miss a Front Controller, which provides a centralized
access point for presentation-tier request handling?

Or do you just miss a Dispatcher, which selects the views to handle
the response.

(Struts comines these into something J2EE Patterns calls "Service to Worker".)

Which is to say, do you need to do something special with each
request, or is that you just need more help in selecting the response?

> I was wondering if any of you knew a Struts like
> framework in the .NET world.

Maverick has a .NET version of a Struts-like framework, but we haven't
been using it.

> how do you use ASP.NET? 

We've been setting our workflows up as panels. One of our pages might
have a dozen different panels, which are turned on and off as a client
proceeds through a workflow. For the most part, the panel approach
lets us get away without a Dispatcher.  Pages lead from a main menu
down to a mulit-panel work flow, and then back to the main menu.

What I started to miss was the centralized Application Controller
features of Struts. Features like

* command selection
* input validation
* text formatting 
* message handling
* fault trapping
* type conversion 
* logic processing
* control population and harvesting

If you think about it, none of these features need to be tied to a
particular presentation layer technology. Most of the featuires are
found in Struts, and some other frameworks. (I think of Struts as the
"unabridged" framework. Many others do what you need, but Struts does
it all.)

ActionMappings select a command. ActionForm validates input.
ActionErrors handles messages. ExceptionHandler catches any runtime
faults. BeanUtils converts types and formats text (to a degree).
Action processes logic. Taglibs populate controls, and the ActionForms
harvest input (using JavaBeans as transfer objects).

What we are starting to do is use the inheritence properites of the
Page Controller for dispatching, and then calling a Controller from
the code-behind. So instead of the Front Controller deciding which
Command to call, the code-behind decides for itself which Command it
needs to call.

We're pushing as much logic up into the Application Controller as we
can. We like to test-first, and so we want to test as much of a
transaction script as possible before plugging it into the
presentation layer. What's left for the Code Behind is bundling up the
input, passing it to the appropriate Command, unbundling the output,
and then turn on or off the appropriate peansl

If you get past the trees, and into the forrest, it's starting to feel
a lot like Struts again :)

 -Ted.

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



Re: Correct Prepopulate Method

2005-03-14 Thread Joe Germuska
This is where I must be doing something wrong, my UserUpdateAction 
isn't finding the pre-populated form. Here is my code for both:
Hm.  is UserUpdateAction expecting certain properties to survive 
between the requests which are not in the request parameters?  By 
default, form beans have request scope, so a new instance of UserBean 
is created upon submission to /userUpdate.do and populated with 
request parameter values.  If you want values to be in the UserBean 
on both requests, you need to include them in the form on 
UserEdit.jsp, if only as hidden fields.

You can add the "scope='session'" attribute to both mappings and then 
Struts will store the form in the user's session, which would deal 
with that problem; this method is often used in a "wizard" process 
where several screens are used to sequentially populate a form 
without needing to use hidden fields to repeatedly resubmit values.

Any chance its something like this?
Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


Re: Correct Prepopulate Method

2005-03-14 Thread Nic Werner
See my comments in-line. You've got the idea of what I want to do, Joe.
Joe Germuska wrote:
At 11:08 PM -0800 3/13/05, Nic Werner wrote:
Is what I am doing calling JSP pages directly? From my struts-config
below I show them being mapped to Actions.
My question was that I have to set the html:form action to be the
calling Action in order to populate it, but I want it to submit to a
different page, and if I follow the Apache struts example as below, it
doesn't follow correctly.

I think I'm missing something.  Your struts-config looks fine:
My struts-config:

   type="com.racquetclub.action.UserEditAction"  
   name="user">
   
   

   type="com.racquetclub.action.UserUpdateAction"
   name="user">
   
   

So the user goes here:
yourserver/yourCtx/userEdit.do
your UserEditAction executes, and is given an instance of ActionForm 
based on the form-bean config with the ID "user".  It prepopulates and 
delivers to the UserEdit.jsp page.

This page includes a form which looks like this:
...
If I set the html:form to be "userUpdate", I get a blank form back, not 
prepopulated. That was my catch, setting it to 'userEdit' gets the right 
info in the form, but I need that data to go over to 'userUpdate'.

Isn't this the model? Action A populates Bean, JSP displays it, and JSP 
submits to Action B for processing.

When the  tag executes, it uses "/userUpdate" to look up an 
action mapping, where it finds that it needs an ActionForm linked to 
the id "user" for prepopulating its fields.  It should find the same 
one which was prepopulated, and the fields should be filled according 
to what UserEditAction set up.
This is where I must be doing something wrong, my UserUpdateAction isn't 
finding the pre-populated form. Here is my code for both:

UserEditAction:
SqlMapClient sqlMap = DatabaseManager.getInstance();
   //ActionForm userForm = (ActionForm) form;
  
   try{
   UserBean userForm = (UserBean)form;
   UserBean user;
   user = 
(UserBean)sqlMap.queryForObject("selectUser",userForm.getUserId());
   BeanUtils.copyProperties(userForm,user);
   }
catch (Exception e)
   {
   e.printStackTrace();
   throw new RuntimeException("Error initializing 
MyAppSQLConfig class. Cause: " + e);
   } 
   return (mapping.findForward("display"));
-
UserUpdateAction
SqlMapClient sqlMap = DatabaseManager.getInstance();
  
   UserBean userForm = (UserBean)form;
   UserBean user;
   try{
   sqlMap.update("updateUser",userForm);
   }
catch (Exception e)
   {
   e.printStackTrace();
   throw new RuntimeException("Error initializing 
MyAppSQLConfig class. Cause: " + e);
   } 
   return (mapping.findForward("success"));

When the form submits, it is processed by a different action at a 
different path linked to the same form-bean ("user").  You might want 
to add "validate='true'" to the "/userUpdate" mapping, unless you're 
not performing any validation with Struts.

What isn't working?  It sounds like you think your form has to submit 
to "/userEdit", but it doesn't, if you have another action mapping 
which uses the same ("user") form bean.

Joe

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


Validator Framework question

2005-03-14 Thread Scott Purcell
I am trying to use the validator framework for some simple form-field 
validation. Under web-inf, I have placed the default validator-rules.xml
eg:
/WEB-INF/validator-rules.xml (from the extracted examples).
and
/WEB-INF/validation.xml (from the storefront example, see below);
 
and in my struts-config.xml file I added this:
  

  

 
So it appears I have put the proper pieces in place, but when the webapp 
starts-up, I get the below error, which looks like it cannot find the files?
Also, I have validated that the files are not bad xml.
 
Any ideas?
 
Thanks,
Scott
 
 
 
Error:
[14/Mar/2005:11:16:52] warning (28749): StandardWrapper[/dealer:dealer]: 
WEB2795: Marking servlet dealer as unavailable
[14/Mar/2005:11:16:52] failure (28749): WebModule[/dealer]: WEB2783: Servlet 
/dealer threw load() exception
javax.servlet.UnavailableException: Cannot load a validator resource from 
'/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml'
at 
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:174)
at 
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:839)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:921)
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:813)
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3478)
at 
org.apache.catalina.core.StandardContext.start(StandardContext.java:3760)
at com.iplanet.ias.web.WebModule.start(WebModule.java:251)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:652)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1133)
at 
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:355)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.iplanet.ias.web.WebContainer.start(WebContainer.java:431)
at com.iplanet.ias.web.WebContainer.startInstance(WebContainer.java:500)
at com.iplanet.ias.server.J2EERunner.confPostInit(J2EERunner.java:161)

 
validation.xml

   
  
phone
^\(?(\d{3})\)?[-| ]?(\d{3})[-| 
]?(\d{4})$
   
  
zip
^\d{5}\d*$
   
   
   
  
zip
^\d{5}(-\d{4})?$
   
  
  
 
  
   
 mask
 ^[a-zA-Z]*$

  
 
 
   
   
   
   
 mask
 ^[a-zA-Z]*$

   
 maxlength
 15
   
 
  
 
   
   
 mask
 ^\w+$
   
  
 
 
  
   
 mask
 ^[a-zA-Z]*$
   
  
 
 
   
   
  mask
  ^[a-zA-Z]*$
   
  
 
 
   
   
   
 mask
 ${zip}

  
 
 
   
   
  mask
  ^[a-zA-Z]*$
   
  
 
 
   
   
   
 mask
 ${phone}
   
  
  
  



Scott K Purcell | Developer | VERTIS | 
555 Washington Ave. 4th Floor | St. Louis, MO 63101 | 
314.588.0720 Ext:1320 | [EMAIL PROTECTED] | http://www.vertisinc.com 
  

Vertis is the premier provider of targeted advertising, media, and 
marketing services that drive consumers to marketers more effectively. 
 

 


Unable to initialize Action Servlet

2005-03-14 Thread Alex Rodrigues da Silva
Hi, when i start the tomcat 5.5.7
i get this SEVERE.
Unable to initialize Struts ActionServlet due to an unexpected exception or 
error thrown, so marking the servlet as unavailable.  Most likely, this is 
due to an incorrect or missing library dependency.
java.lang.NoClassDefFoundError: 
org/apache/commons/validator/ValidatorResources
i have the package commons.validator at tomcat/commons/lib.
before, this was at myapp/WEB-INF/lib,
i change the local, and nothing.
the version of struts is 1.2.4.
and i'm using linux.
my classpath haven't the location of commons-*.jar, because i think then they 
are at myapp/WEB-INF/lib.
Can you help me?

thanks

-- 
Alex Rodrigues da Silva
Analista de Sistemas
tel.: 55 21 8825-1967
[EMAIL PROTECTED]
Linux User #378866

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



RE: Request Processor validation Question

2005-03-14 Thread Antony Joseph
Correction.  Default implementation uses any configured roles. Your 
implementation can override this and implement whatever logic you want.

- Original Message -
From: "Antony Joseph" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Subject: RE: Request Processor validation Question
Date: Mon, 14 Mar 2005 11:36:44 -0500

> 
> There is nothing special about processRoles(). It just returns true 
> by default.You can overide it and implement whatever logic you want 
> in it. It is not tied to any J2ee mechanism.
> 
> - Original Message -
> From: "Scott Purcell" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" 
> Subject: RE: Request Processor validation Question
> Date: Mon, 14 Mar 2005 10:18:34 -0600
> 
> >
> > If I use the processRoles(), does that mean I have to use the 
> > J2EE authentication mechanism for web applications? Using the 
> > container and declare the applications declaratively?
> >
> > I am using a database with form-based authentication and just 
> > want to find out whether the user is logged in, and if so he can 
> > keep working, else if he is not logged in and is trying to access 
> > a page that requires he be logged in, then take him to the front 
> > door.
> >
> > Thanks,
> > Scott
> >
> > -Original Message-
> > From: Antony Joseph [mailto:[EMAIL PROTECTED]
> > Sent: Monday, March 14, 2005 9:56 AM
> > To: Struts Users Mailing List
> > Subject: Re: Request Processor validation Question
> >
> >
> > Hi Scott,
> > Check the javadocs for the RequestProcessor. Any method which has 
> > an ActionMapping as an argument can be used to figure out the 
> > action (ex: mapping.getPath()). If you plan to do authorization 
> > the method processRoles() is a good candidate to be overriden.
> >
> > - Original Message -
> > From: "Scott Purcell"
> > To: user@struts.apache.org
> > Subject: Request Processor validation Question
> > Date: Mon, 14 Mar 2005 09:31:35 -0600
> >
> > >
> > > Hello, I have extended the RequestProcessor and I am looking 
> > for > a way to find out where the page is going to. The reason 
> > for this > is as follows. I am giving each user a UserObject when 
> > they hit > the site. Later on, after they log in, I set some 
> > flags to know > they are valid inside the application. I am just 
> > using a boolean > "isLoggedIn". Anyway I need a way to find out 
> > which Action they > are heading to and put some logic in my 
> > extended RequestProcessor > class, that could check which Action 
> > and send them to the login, > if an action they want to use is 
> > past the login page. If I know > the action and they are just 
> > logging in, I will not show them a > "session expired" flag. But 
> > if they are heading for an inside > page (a page they need to be 
> > logged in for), and the object says > "not logged in" then of 
> > course, I want to take them to the front > door and show a msg 
> > stating "session expired.". I have gone > through the 
> > RequestProcessor docs, but do not see anyway to get > the 
> > action.? Any ideas. Thanks, Scott
> >
> >
> >
> >
> >
> >
> > Antony Joseph
> > http://www.logicden.com
> > https://workeffort.dev.java.net
> > --
> > ___
> > NEW! Lycos Dating Search. The only place to search multiple 
> > dating sites at once.
> > http://datingsearch.lycos.com
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> Antony Joseph
> http://www.logicden.com
> https://workeffort.dev.java.net
> 
> --
> ___
> NEW! Lycos Dating Search. The only place to search multiple dating 
> sites at once.
> http://datingsearch.lycos.com
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net

-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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



Re: Struts tags and enums

2005-03-14 Thread Nicolas De Loof
You can use jakarta unstandard taglib to "bind" a variable to the static 
fiedl YES



Nico.
Vinicius Caldeira Carvalho a écrit :
Hello there! I'm using enum types in my app and I'd like to use 
combine them with struts tags.
My enum class hierarchy descends to PersistenEnum (the example on 
hibernate)
a method called getEnumCode() returns a Serializable that represents 
the code for that enum :P

So far what I'm doing is:
<%String code = String.valueOf(YesNoEnum.YES.getEnumCode())%>

This of course s cuz I have to import the enum and also adds 
scriptlets to my jsp. So I tried the struts-el using:
value="{YesNoEnum.YES.enumCode}"
not working either.

Anyone has a good experience with that?
Thanks
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This message contains information that may be privileged or confidential 
and is the property of the Capgemini Group. It is intended only for the person 
to whom it is addressed. If you are not the intended recipient,  you are not 
authorized to read, print, retain, copy, disseminate,  distribute, or use this 
message or any part thereof. If you receive this  message in error, please 
notify the sender immediately and delete all  copies of this message.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Struts tags and enums

2005-03-14 Thread Vinicius Caldeira Carvalho
Hello there! I'm using enum types in my app and I'd like to use combine 
them with struts tags.
My enum class hierarchy descends to PersistenEnum (the example on hibernate)
a method called getEnumCode() returns a Serializable that represents the 
code for that enum :P

So far what I'm doing is:
<%String code = String.valueOf(YesNoEnum.YES.getEnumCode())%>

This of course s cuz I have to import the enum and also adds 
scriptlets to my jsp. So I tried the struts-el using:
value="{YesNoEnum.YES.enumCode}"
not working either.

Anyone has a good experience with that?
Thanks
Vinicius
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Request Processor validation Question

2005-03-14 Thread Antony Joseph
There is nothing special about processRoles(). It just returns true by 
default.You can overide it and implement whatever logic you want in it. It is 
not tied to any J2ee mechanism.

- Original Message -
From: "Scott Purcell" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Subject: RE: Request Processor validation Question
Date: Mon, 14 Mar 2005 10:18:34 -0600

> 
> If I use the processRoles(), does that mean I have to use the J2EE 
> authentication mechanism for web applications? Using the container 
> and declare the applications declaratively?
> 
> I am using a database with form-based authentication and just want 
> to find out whether the user is logged in, and if so he can keep 
> working, else if he is not logged in and is trying to access a page 
> that requires he be logged in, then take him to the front door.
> 
> Thanks,
> Scott
> 
> -Original Message-
> From: Antony Joseph [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 14, 2005 9:56 AM
> To: Struts Users Mailing List
> Subject: Re: Request Processor validation Question
> 
> 
> Hi Scott,
> Check the javadocs for the RequestProcessor. Any method which has 
> an ActionMapping as an argument can be used to figure out the 
> action (ex: mapping.getPath()). If you plan to do authorization the 
> method processRoles() is a good candidate to be overriden.
> 
> - Original Message -
> From: "Scott Purcell"
> To: user@struts.apache.org
> Subject: Request Processor validation Question
> Date: Mon, 14 Mar 2005 09:31:35 -0600
> 
> >
> > Hello, I have extended the RequestProcessor and I am looking for 
> > a way to find out where the page is going to. The reason for this 
> > is as follows. I am giving each user a UserObject when they hit 
> > the site. Later on, after they log in, I set some flags to know 
> > they are valid inside the application. I am just using a boolean 
> > "isLoggedIn". Anyway I need a way to find out which Action they 
> > are heading to and put some logic in my extended RequestProcessor 
> > class, that could check which Action and send them to the login, 
> > if an action they want to use is past the login page. If I know 
> > the action and they are just logging in, I will not show them a 
> > "session expired" flag. But if they are heading for an inside 
> > page (a page they need to be logged in for), and the object says 
> > "not logged in" then of course, I want to take them to the front 
> > door and show a msg stating "session expired.". I have gone 
> > through the RequestProcessor docs, but do not see anyway to get 
> > the action.? Any ideas. Thanks, Scott
> 
> 
> 
> 
> 
> 
> Antony Joseph
> http://www.logicden.com
> https://workeffort.dev.java.net
> --
> ___
> NEW! Lycos Dating Search. The only place to search multiple dating 
> sites at once.
> http://datingsearch.lycos.com
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net

-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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



RE: Request Processor validation Question

2005-03-14 Thread Scott Purcell
If I use the processRoles(), does that mean I have to use the J2EE 
authentication mechanism for web applications? Using the container and declare 
the applications declaratively?

I am using a database with form-based authentication and just want to find out 
whether the user is logged in, and if so he can keep working, else if he is not 
logged in and is trying to access a page that requires he be logged in, then 
take him to the front door.

Thanks,
Scott

-Original Message-
From: Antony Joseph [mailto:[EMAIL PROTECTED]
Sent: Monday, March 14, 2005 9:56 AM
To: Struts Users Mailing List
Subject: Re: Request Processor validation Question


Hi Scott,
Check the javadocs for the RequestProcessor. Any method which has an 
ActionMapping as an argument can be used to figure out the action (ex: 
mapping.getPath()). If you plan to do authorization the method processRoles() 
is a good candidate to be overriden.

- Original Message - 
From: "Scott Purcell" 
To: user@struts.apache.org 
Subject: Request Processor validation Question 
Date: Mon, 14 Mar 2005 09:31:35 -0600 

> 
> Hello, 
> I have extended the RequestProcessor and I am looking for a way to 
> find out where the page is going to. The reason for this is as 
> follows. I am giving each user a UserObject when they hit the site. 
> Later on, after they log in, I set some flags to know they are 
> valid inside the application. I am just using a boolean 
> "isLoggedIn". Anyway I need a way to find out which Action they are 
> heading to and put some logic in my extended RequestProcessor 
> class, that could check which Action and send them to the login, if 
> an action they want to use is past the login page. 
> 
> If I know the action and they are just logging in, I will not show 
> them a "session expired" flag. But if they are heading for an 
> inside page (a page they need to be logged in for), and the object 
> says "not logged in" then of course, I want to take them to the 
> front door and show a msg stating "session expired.". 
> 
> I have gone through the RequestProcessor docs, but do not see 
> anyway to get the action.? 
> 
> Any ideas. 
> 
> Thanks, 
> Scott 
> 
> 
> 






Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net
-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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


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



Re: Request Processor validation Question

2005-03-14 Thread Antony Joseph
Hi Scott,
Check the javadocs for the RequestProcessor. Any method which has an 
ActionMapping as an argument can be used to figure out the action (ex: 
mapping.getPath()). If you plan to do authorization the method processRoles() 
is a good candidate to be overriden.

- Original Message - 
From: "Scott Purcell" 
To: user@struts.apache.org 
Subject: Request Processor validation Question 
Date: Mon, 14 Mar 2005 09:31:35 -0600 

> 
> Hello, 
> I have extended the RequestProcessor and I am looking for a way to 
> find out where the page is going to. The reason for this is as 
> follows. I am giving each user a UserObject when they hit the site. 
> Later on, after they log in, I set some flags to know they are 
> valid inside the application. I am just using a boolean 
> "isLoggedIn". Anyway I need a way to find out which Action they are 
> heading to and put some logic in my extended RequestProcessor 
> class, that could check which Action and send them to the login, if 
> an action they want to use is past the login page. 
> 
> If I know the action and they are just logging in, I will not show 
> them a "session expired" flag. But if they are heading for an 
> inside page (a page they need to be logged in for), and the object 
> says "not logged in" then of course, I want to take them to the 
> front door and show a msg stating "session expired.". 
> 
> I have gone through the RequestProcessor docs, but do not see 
> anyway to get the action.? 
> 
> Any ideas. 
> 
> Thanks, 
> Scott 
> 
> 
> 






Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net
-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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



Request Processor validation Question

2005-03-14 Thread Scott Purcell
Hello,
I have extended the RequestProcessor and I am looking for a way to find out 
where the page is going to. The reason for this is as follows. I am giving each 
user a UserObject when they hit the site. Later on, after they log in, I set 
some flags to know they are valid inside the application. I am just using a 
boolean "isLoggedIn". Anyway I need a way to find out which Action they are 
heading to and put some logic in my extended RequestProcessor class, that could 
check which Action and send them to the login, if an action they want to use is 
past the login page. 
 
If I know the action and they are just logging in, I will not show them a 
"session expired" flag. But if they are heading for an inside page (a page they 
need to be logged in for), and the object says "not logged in" then of course, 
I want to take them to the front door and show a msg stating "session expired.".
 
I have gone through the RequestProcessor docs, but do not see anyway to get the 
action.?
 
Any ideas.
 
Thanks,
Scott
 
 
 


[OT] Fresh Blood

2005-03-14 Thread Rick Reumann
Your friendly neighborhood losers are still hanging out in 
#FunkyCodeMonkey on irc.darkmyst.org and wouldn't mind having some fresh 
blood in the channel. (We're getting tired of making fun of the same 
people all day:) Actually come by and babble about your favorite 
flavor-of-the-month framework or just how cool you think Java or .NET 
is:) - we don't care - come by and just lurk if you want. We actually 
answer the occasional struts or iBATIS question also. Hope to see  you 
there.

If you need an irc client:
mIRC http://www.mirc.com/ (windows only)
XChat http://www.xchat.org/ (windows/linux)
Chatzilla http://www.mozilla.org/projects/rt-messaging/chatzilla/
Opera (built in client)
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [OT]Pop-Up Window and getParameter()

2005-03-14 Thread Leon Rosenberg
yes, but you'd need to store all data from a popup window via javascript
into your document (web page) OR to have an action inbetween, which is
called on pop-up window submit, and stores the values in the session or
something for later retrieval.
leon

On Mon, 2005-03-14 at 06:56 -0800, Caroline Jen wrote:
> I have used the getParameter() to retrieve data from
> web page text fields.  No problem so far.
>  
> Now, I have a web page that has a number of text
> fields.  In addition, the JavaScript is used in this
> web page to pop-up another window for users to enter
> more data in some text fields and a textarea.  When
> uses click on the OK button provided in this pop-up
> window, it disappears from the screen.
>  
> Can the data entered in this pop-up window be read by
> the getParameter() method in a servlet?
> 
> __
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 



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



[OT]Pop-Up Window and getParameter()

2005-03-14 Thread Caroline Jen
I have used the getParameter() to retrieve data from
web page text fields.  No problem so far.
 
Now, I have a web page that has a number of text
fields.  In addition, the JavaScript is used in this
web page to pop-up another window for users to enter
more data in some text fields and a textarea.  When
uses click on the OK button provided in this pop-up
window, it disappears from the screen.
 
Can the data entered in this pop-up window be read by
the getParameter() method in a servlet?

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: Correct Prepopulate Method

2005-03-14 Thread Joe Germuska
At 11:08 PM -0800 3/13/05, Nic Werner wrote:
Is what I am doing calling JSP pages directly? From my struts-config
below I show them being mapped to Actions.
My question was that I have to set the html:form action to be the
calling Action in order to populate it, but I want it to submit to a
different page, and if I follow the Apache struts example as below, it
doesn't follow correctly.
I think I'm missing something.  Your struts-config looks fine:
My struts-config:

   type="com.racquetclub.action.UserEditAction"  
   name="user">
   
   

   type="com.racquetclub.action.UserUpdateAction"
   name="user">
   
   
So the user goes here:
yourserver/yourCtx/userEdit.do
your UserEditAction executes, and is given an instance of ActionForm 
based on the form-bean config with the ID "user".  It prepopulates 
and delivers to the UserEdit.jsp page.

This page includes a form which looks like this:
...
When the  tag executes, it uses "/userUpdate" to look up 
an action mapping, where it finds that it needs an ActionForm linked 
to the id "user" for prepopulating its fields.  It should find the 
same one which was prepopulated, and the fields should be filled 
according to what UserEditAction set up.

When the form submits, it is processed by a different action at a 
different path linked to the same form-bean ("user").  You might want 
to add "validate='true'" to the "/userUpdate" mapping, unless you're 
not performing any validation with Struts.

What isn't working?  It sounds like you think your form has to submit 
to "/userEdit", but it doesn't, if you have another action mapping 
which uses the same ("user") form bean.

Joe
--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

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


forward

2005-03-14 Thread sudip shrestha
I have certain situations when I have to forward the web page upon
success to a certaion action or to a page with url such that it has a
query string with it: e.g.:
"/actions/myActionxx.do?wId=123" or "/pages/myPagexx.do?wId=123"

Now, I can't provide the query strings with ids in struts-config.xml
file as the ids change depending upon the situation. So was wondering
if there was any other way around to it?

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



Re: Struts Menu

2005-03-14 Thread Matt Raible
On Mar 14, 2005, at 5:31 AM, Antony Joseph wrote:
Hi Vijaya,
You will need an entry in the web.xml similar to the one below:
  
/WEB-INF/struts-menu
/WEB-INF/struts-menu.tld
  
You should only need this if the URI in your JSP taglib declaration 
points to the URI in your web.xml.  2.3 Servlet containers will scan 
JARs and pick up the URIs from there.

Can you post your displayer mappings (from the top of menu-config.xml) 
and the struts-menu part of your JSP?

Also, what version of Struts Menu are you using?
Matt
If you are still having problems, check out the application 
https://workeffort.dev.java.net . It uses struts-menu.

- Original Message -
From: "Vijaya S" <[EMAIL PROTECTED]>
To: "Struts User mailing List" 
Subject: Struts Menu
Date: Mon, 14 Mar 2005 10:47:58 +0530
Hi,
Has anyone successfully implemented Struts Menu in your application? 
I am
getting an error as
'The displayer mapping for the specified MenuDisplayer does not 
exist'.

I have done the following
1. In my struts-config I have included the plugin
2. I have placed my menu-config.xml under WEB-INF.
3. My jsp has the corresponding taglibs included
4. struts-menu jar is placed under the lib directory of my 
application.

Am I missing anything else? I posted my problem in struts-menu user 
list but
no replies. If anyone of you is successful with struts-menu, can you 
please
tell me what I am doing wrong?

Thanks,
Vijaya

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

Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net
--
___
NEW! Lycos Dating Search. The only place to search multiple dating 
sites at once.
http://datingsearch.lycos.com

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

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


Tiles does not function in case validation error?

2005-03-14 Thread Daniel PC Leung
In case validation error, the header, footer and menu portions
disappear when error messages display on top of the body page which
occupies the whole screen.

If I can click "cancel" or validation is okay, Tiles function
properly. Only the body page is changed.



  
  
  



Anything I can change? 

thanks

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



RE: using the validwhen validator

2005-03-14 Thread Reddy, Ajith
Hi Niall,

I was following the same example that you sent me even before I mailed
you. I had the validations.xml file exactly the same as you pointed in
your old example. Only problem was that I didn't have the ORs and ANDs
in lower case and that caused the problem. I fixed that and now it works
fine.

Thanks,
Ajith

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 11, 2005 5:28 PM
To: Struts Users Mailing List
Subject: Re: using the validwhen validator


Does this help?

http://www.mail-archive.com/user@struts.apache.org/msg22433.html

Niall

- Original Message - 
From: "Reddy, Ajith" <[EMAIL PROTECTED]>
To: 
Sent: Friday, March 11, 2005 8:45 PM
Subject: using the validwhen validator


Sorry for my previous incomplete mail.
 
Here is the problem again:
 
Our problem is that we have a checkbox(ChangeAddredd) called "check here
to enter and change address". Once this is checked there are some
address fields that need to be entered. We want error messages to be
displayed when user enters address fields without checking the checkbox
and also vice versa. I understand that " Only two items may be joined
with and or or ". I tried using an older suggestion and wrote my
validations.xml as: 
 
For now I have the using a textbox in place of checkBox just to make it
work. Buit even when I donot enter anything I get all the errors. Please
advise.

http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd>
http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd " >

  

  


  test
  
  ((*this* != null) OR 
  ((NameRev == null) AND
  ((Address1Rev == null) AND
  ((CityRev == null) AND
   (ZipcodeRev == null)
  )
  )
  )
  )


  
  


  test
  ((*this* != null) OR (ChangeAddress ==
N))

  
  


  test
  ((*this* != null) OR (ChangeAddress ==
N))

  
  


  test
  ((*this* != null) OR (ChangeAddress ==
N))

  
  


  test
  ((*this* != null) OR (ChangeAddress ==
N))

  

  



I also get these parse errors :

05/03/11 15:41:57 line 1:19: unexpected token: OR

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.join(ValidWhenPars
er.java:442)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.joinedExpression(V
alidWhenParser.java:410)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expr(ValidWhenPars
er.java:383)

05/03/11 15:41:57  at
org.apache.struts.validator.validwhen.ValidWhenParser.expression(ValidWh
enParser.java:369)

05/03/11 15:41:57  at

Any suggestions please.

-Ajith




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


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



Re: [Slightly OT] Intuitive way of multi-select?

2005-03-14 Thread Sebastian Hennebrueder
What about to lists
the first one is the source list, the second one the "selected" list.
You can select an item and send it via javascript to the second list.
On submit everything is updated.
Regards
Sebastian Hennebrueder

http://www.laliluna.de
Tutorials for JSP, JavaServer Faces, Struts, Hibernate and EJB
Vamsee Kanakala wrote:
Hello,
   I have been mulling over how to provide a simple way of
multi-select. Some  how, I'm not very comfortable with providing the
normal way of enlarged drop down list, which the users have use
Ctrl+click to select. The reason is that this becomes messy when they
come back to edit their selections.
   The only other option I see is to provide bunch of checkboxes.
Is there any other way of providing a simple way of doing multi-select
in an edit-friendly way?
TIA,
Vamsee.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


[Slightly OT] Intuitive way of multi-select?

2005-03-14 Thread Vamsee Kanakala
Hello,

   I have been mulling over how to provide a simple way of
multi-select. Some  how, I'm not very comfortable with providing the
normal way of enlarged drop down list, which the users have use
Ctrl+click to select. The reason is that this becomes messy when they
come back to edit their selections.

   The only other option I see is to provide bunch of checkboxes.
Is there any other way of providing a simple way of doing multi-select
in an edit-friendly way?

TIA,
Vamsee.

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



Re: Struts Menu

2005-03-14 Thread Antony Joseph
Hi Vijaya,
You will need an entry in the web.xml similar to the one below:
  
/WEB-INF/struts-menu
/WEB-INF/struts-menu.tld
  

If you are still having problems, check out the application 
https://workeffort.dev.java.net . It uses struts-menu.

- Original Message -
From: "Vijaya S" <[EMAIL PROTECTED]>
To: "Struts User mailing List" 
Subject: Struts Menu
Date: Mon, 14 Mar 2005 10:47:58 +0530

> 
> Hi,
> 
> Has anyone successfully implemented Struts Menu in your application? I am
> getting an error as
> 'The displayer mapping for the specified MenuDisplayer does not exist'.
> 
> I have done the following
> 1. In my struts-config I have included the plugin
> 2. I have placed my menu-config.xml under WEB-INF.
> 3. My jsp has the corresponding taglibs included
> 4. struts-menu jar is placed under the lib directory of my application.
> 
> Am I missing anything else? I posted my problem in struts-menu user list but
> no replies. If anyone of you is successful with struts-menu, can you please
> tell me what I am doing wrong?
> 
> Thanks,
> Vijaya
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



Antony Joseph
http://www.logicden.com
https://workeffort.dev.java.net

-- 
___
NEW! Lycos Dating Search. The only place to search multiple dating sites at 
once.
http://datingsearch.lycos.com


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



Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
Nic, the pages don't matter in a real sense.  Actions process requests
using the data from ActionForms and then return an ActionForward. 
Anytime you want to process a request use them.  It is that simple.

If you just explain what you want to do, we can give you a dozen ways
to do it in all probablility that are easy to follow.  Just state what
you want to happen from the point of view of the client using the
browser or the browser itself.  Okay?  I promise you that it will be
very easy if you state the problem and quit worrying about pages.

Jack

-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



Re: Correct Prepopulate Method

2005-03-14 Thread Dakota Jack
But, Craig has indicated in other places that he thinks my way of
doing it resonates with him fine and is consistent with OOP
principles.  Anyway, who created it and why is a historical answer. 
The question, I thought, was about logic?  ///;-)




On Sun, 13 Mar 2005 21:31:43 -0800, Craig McClanahan <[EMAIL PROTECTED]> wrote:
> On Fri, 11 Mar 2005 09:31:33 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote:
> >
> > If you do this, you won't think of the ActionForm as some sort of
> > mirror of the JSP/HTML form which stands between the Action and the
> > form.
> 
> The fact that ActionForm was designed originally *precisely* to be a
> container for the server side state of a JSP/HTML form is totally
> beside the point :-).
> 
> Jack doesn't like using it that way, and that's fine -- but that was
> exactly the original intent.  And this is why his ideas don't always
> resonate with people who use Struts the way it was originally created.
> 
> Craig
> 


-- 
"You can lead a horse to water but you cannot make it float on its back."
~Dakota Jack~

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



RE: [ANN] Struts-JSF London Networking BOF VIII / Tuesday / 15th March 2005 @ 18:45 / Oracle City of London

2005-03-14 Thread Pilgrim, Peter
> From: Pilgrim, Peter 

See intermixed 

====

This is just another reminder of BOF 8 Struts-JSF London Networking 
happening tomorrow; Tuesday, 15th March 2005 starting 6:45 PM at 
Oracle City of London offices.

This is first meetup not at an restaurant or a public bar with 
some A/C Mains Power! So here is a grand `OPPORTUNITY' to bring
your laptop and your Struts / Faces / J2EE problems to forum!


The presentations on JSF and/or Shale, which should take upto
one hour. There will be plenty of time for questions & answer
and group discussion. The structure is informal and everyone
is encouraged to participate.

Thanks again for Duncan Mills for submitting the venue again
to the group. 

Lets make it a good one. Thanks

> 
> > From: Pilgrim, Peter 
> ====
> 
> WHAT:
> 
> This is just a `reminder' that ``The Struts-JSF London Networking'' 
> group is holding the eight meet-up event next Tuesday 15th March 2005 
> at Oracle office in the city of London at ``18:45''
> 
> The meeting will take place in a room with Audio/Visual facilities
> between 7-9 pm. Afterwords members can retire to the nearby 
> Red Lion pub for more in depth discussion ...
> 
> WHERE:
> 
> The address is:
>   Oracle City Of London
>   One South Place
>   London,
>   England
>   EC2M 2RB.
> 
> Here is some relevant travel information 
> 
> By Underground: -
> 
>Moorgate: Take the Moorgate East exit, turn right, one 
> block to South 
> Place.
>Bank: Take the Northern line to Moorgate.
>Liverpool Street:Take the Broadgate exit, turn right onto 
> South Place
> 
> Map:   
http://www.oracle.com/global/uk/corporate/locations/citymap.html


The venue has kindly been organised by Duncan Mills. We all appreciate
this generous gift. Duncan has offered to also set up meal requirements.
Normally this is geared towards buffet and/or sandwiches, but Oracle
could specially request pizzas if you so desire.

AGENDA:
Duncan Mills will present/discuss Shale and JavaServer Faces
Peter Pilgrim will present/discuss X (Something related to J2EE?)


WHO:
> 
> I'm back from annual vacation in France. We have just over a week
> to go the next BOF VIII. Has there been any issues? 
> 
> Some far I have the following attendees in order of email inbox times.
> 
>   Alan Mehio
>   Matthew Dudbridge
>   Charles Cordingley
>   Jim Collins
>   Christopher Marsh-Bourdon
> 

John Bell

> and of course
> 
> Pete Pilgrim
> Duncan Mills
> 
> Anymore takers?
> 
> 
====


Not a member? No worrys mate, it's free. Just send me an [OT] email 
or surfs up at
http://www.strutslondon.com  or 
http://struts.meetup.com 


PS: Food is discussed in another mail

--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston, 
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497




--
Peter Pilgrim
Operations/IT - Credit Suisse First Boston, 
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497


==
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==


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



changing Format in bean write

2005-03-14 Thread VIALE G Ext ROSI/DPS
Hello,

i changed Date Format Symbols in a class but can i apply this changement with 
struts tag ?

call a method in my jsp for reformat ?

thx.


Cordialement,

Grégory VIALE Ext ROSI/DPS
Ingénieur d'etudes
tel: 01 55 88 62 75

mailto:[EMAIL PROTECTED]


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



Re: session and request scope

2005-03-14 Thread Manfred Wolff
Radu.
To avoid such problems you may use contextes. When you have contextes 
stored in the session and you store your values only in this context you 
have no problem to clean the session. There is a small architecture 
project called struts-it (struts-it.org) in detail 
http://plstrutsit.sourceforge.net/architecture/presentation.html, 
provides such a context. The signature of an execute-method is such as

public void execute(Context context);
where a context is a commons-chain context. The Request processor has 
the responsibility to create such contextes and share them over an 
use-case. This approuch is available for struts 1.2 as well as struts 1.1.

I think the struts-chain (1.3) has the same approuch. Dealing witch 
contextes is quite nice, because you can use this context in the 
business layer too.

Manfred
Radu Badita wrote:
At 08:14 14.03.2005, Craig McClanahan wrote:
For a developer, though, you should train yourself to good habits in
the first place -- use request scope for *everything* unless it
absolutely must be saved, on the server side, in between requests from
the same user.

This sounds like common-sense but is only feasible in theory; that's 
because in non-trivial web-apps almost all the interactions are some 
kind of a dialog spanning multiple requests with the user and 
inevitably require session-stored data between request. Cleaning such 
data when the "dialog" ends becomes a pain.
I hope that the "Dialog Controller" in the forecoming Shale will 
address this problem and provide the means for a "dialog-local 
session" that will automatically be released once the dialog 
completes. Furthermore, once a user is in the middle of such a 
pageflow, it shouldn't be possible to leave (requesting another dialog 
sequence) until the current one finishes.
I've once worked with a home-made web framework which implemented such 
behavior (like a state machine) where the entire application was 
divided into states (each having a corresponding view), each state 
could have transitions (a transition executing an action) to other 
states or to another sub-application. Each "state machine" had it's 
own separate session which was removed on execution end. Between 
state-machines parameters could be sent by-value copying from one 
session to the other. All this was specified in an external xml doc. 
Too bad it was lacking a system for automating request and session 
parameters retrieval (like the ActionForms in Struts).
That is the behavior that I would personally like in Shale, because I 
think it allows for much better design and reuse.

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

--
===
Dipl.-Inf. Manfred Wolff
Software Engineer
---
http://www.manfred-wolff.de
http://www.struts-it.org
---

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


class TagUtils, retrieving a message bundle, code modification re quest

2005-03-14 Thread Lesaint Sébastien
Hello,

I've been looking into the source code (of both 1.2.4 and 1.2.6, not cvs),
and I have a question about the way a message bundle is looked up based on
its name.

I understand from the code that the resource bundle is search:
 - in the page context
 - if not found, in the request context
 - if not found, in the application context

This process make perfectly sense for me but I'm surprised how the search in
the application context is done. From the code, we can see that the bundle
is first searched by its name + the module prefix, then by its raw name.

I would have done it the other way around, for two reasons:
 - If I specify in the code the correct bundle name with the module prefix
appended, there is an extra search done (the one for "name + module prefix +
module prefix")
 - If I have two resources bundles, one in the default module, one in a
module "foo", with the same name in the config file, let's say for pictures
(so it would be called "ImagesResources"). If I am in the module foo, I
can't get access to the bundle "ImageResources" of the default module
because it will always find the bundle "ImagesResources/foo" first.


Before proposing reporting anything in bugzilla, I would like to know the
opinion of the community on this issue (assuming that I managed to make it
clear): should the lookup in application context be done first by raw name
or by "name + module prefix"?

Seb'


Re: session and request scope

2005-03-14 Thread Radu Badita
At 08:14 14.03.2005, Craig McClanahan wrote:
For a developer, though, you should train yourself to good habits in
the first place -- use request scope for *everything* unless it
absolutely must be saved, on the server side, in between requests from
the same user.
This sounds like common-sense but is only feasible in theory; that's 
because in non-trivial web-apps almost all the interactions are some kind 
of a dialog spanning multiple requests with the user and inevitably require 
session-stored data between request. Cleaning such data when the "dialog" 
ends becomes a pain.
I hope that the "Dialog Controller" in the forecoming Shale will address 
this problem and provide the means for a "dialog-local session" that will 
automatically be released once the dialog completes. Furthermore, once a 
user is in the middle of such a pageflow, it shouldn't be possible to leave 
(requesting another dialog sequence) until the current one finishes.
I've once worked with a home-made web framework which implemented such 
behavior (like a state machine) where the entire application was divided 
into states (each having a corresponding view), each state could have 
transitions (a transition executing an action) to other states or to 
another sub-application. Each "state machine" had it's own separate session 
which was removed on execution end. Between state-machines parameters could 
be sent by-value copying from one session to the other. All this was 
specified in an external xml doc. Too bad it was lacking a system for 
automating request and session parameters retrieval (like the ActionForms 
in Struts).
That is the behavior that I would personally like in Shale, because I think 
it allows for much better design and reuse.

Radu 


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


Re: Anybody who can answer this ?

2005-03-14 Thread Vamsee Kanakala
nitin dubey wrote:
My question is where can we write
that ? In A's Action or in B's Action ?  Any simple
pattern that can be used for this ?
 

Neither. You can write it in A's action when you are pretty sure that A 
will be called before B. You can't write that in B because your 
'execute' in B will be called only after B's form is populated. I think, 
what you are looking for is a 'PrepareAction' class. Please check Rick's 
excellent tutorial:

http://www.reumann.net/struts/lesson2.do
-Vamsee Kanakala.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]