RE: PDF File Display in JSP-Struts

2003-11-12 Thread David Gagnon
It's not the Internet Explorer problem with pdf ?  Check
http://xml.apache.org/fop/servlets.html#ie

Let me know ... I can give clue on how I solved it.

/David

-Message d'origine-
De : Abhijeet Mahalkar [mailto:[EMAIL PROTECTED]
Envoyé : 10 novembre, 2003 07:55
À : Struts Users Mailing List
Cc : WebSphere User Group Tech Q & A Forum
Objet : PDF File Display in JSP-Struts



Hi All,
 I want to display one PDF file in my websphere struts framework. when i do
it without struts (only servlets ) it works but when i use JSP along with
struts it does not work. it does not read binary data properly... Is there
any body to help me out


regards & thankx in advace...
Abhijeet Mahalkar


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



Question regarding Tags and the release() method

2003-09-24 Thread David Gagnon
Hi all,

  It's probably not a bug, but I can't figure it out. 
I wrote a Tag that inherit from BaseHandlerTag.  The
onclick (per example) property of the BaseHandlerTag
is only reseted in the BaseHandlerTag release()
method.

  The problem is that the release method is called
only when the container wants to release a tag.  In
Tomcat that will happen if the TagPool is already
full.  The point is that release() is not called
between usage.  That means the onclick property is
never reseted between usage?!  

  In my tag I need to add something to the onclick
property .. so it get bigger at each call. For the
sake of clarity :-) Here is a part of my code.

...
   String origOnClick = this.getOnclick();
if (origOnClick == null) {
origOnClick = "";
}
...
this.setOnclick(origOnClick + ";" + jsCall +
"disableAllSubmitButton();this.form.submit();");



I found this on the net regarding the proper use of
the release() method
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16001

It seem clear that in Tomcat it will stick to the
spec.  

I know, I can reset the BaseHandlerTag properties in
my Tag ... but for what I understand so far there is a
bug in the BaseHandlerTag.  The BaseHandlerTag should
reset is properties in the doStartTag() method.

Is anywone can point me where I'm wrong ... It seems
to big to be a bug ... 

Thanks for your help
/David






__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: Token in struts and session bean.... problem with the framework ?

2003-06-18 Thread David Gagnon
>>Works well when deployed in a trusted environment
>like intranet.  (But 
>>no server side protection...)
>
>You *always* need server side checking, even >in
"trusted" environments.  
>Client side checking is a luxury for the user,
>nothing more.

Agree :-)
>
>>-There is no way to avoid ActionForm with session
>>scope to be populated with data comming from an
>>invalid request (with a bad token).
>
>I'm still not sure why this is a problem.  Even if
>the form contains bad 
>data, nothing will be done with the data if you
>check for the bad token and 
>forward to an error page.

Oki, let say the user double click on the submit
button, so you have request A and Request B.

A is valid and is been processed when B reach the
server.  The session ActionForm is populated with B's
data while A is still processing the same bean.  You
have a race and there is no way to avoid it.  

Per example, Struts may be calling the reset method on
the session ActionForm for B when A will be accessing
the ActionForm data. ... Anything can happen :-)  Hope
it's more clear ... :-)

Thanks for your help anyway :-)

/David

P.S.:  In fact it seem to me to be a more general race
problem (i.e.: When you have a session ActionForm and
2 requests using the same ActionForm you have a race).






__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: Token in struts and session bean.... problem with the framework ?

2003-06-18 Thread David Gagnon

Hi all thanks for your answers.

  I was indeed talking about ActionForm (sorry we use
to call that a bean here :-)).  

  What I understand from our discussion is:
-Thant I Can use javascript to avoid duplicate submit:
Works well when deployed in a trusted environment like
intranet.  (But no server side protection...)
-There is no way to avoid ActionForm with session
scope to be populated with data comming from an
invalid request (with a bad token).

-To solve that I can subclass the request processor.

-Maybe I can use web filter ... but i don't think I
will have access to all struts ressources.

I think the best way to handle the problem on the
server is to have a Handler (Something that can work
as Exception Handler works in Struts 1.1.
) called by the struts framework prior to populate the
bean. This handler can do any checks like checking if
the user is logged or checking if a valid token in the
request is present :-).  

Anyway, thanks for you help!

/David

  

> > >It's up to your Action to call the token methods
to validate the 
> > >token and forward the user to an appropriate
page.
> > >
> >
>  I know, maybe I wasn't clear enough .. sorry :-)
>What I'm saying is that if you use a
>  session bean, the content is modified even though
the
>token is invalid.. I thinks this should not happen.

By session bean, do you mean EJB or an ActionForm
stored in the session?  I 
haven't tried this but maybe you could put the token
check in the form's 
validate method but that also happens after the form
bean is populated.  The 
token is currently viewed as a piece of form data for
the Action to handle 
and not the framework.  Allowing actions to check the
token gives people the 
flexibility of deciding what to do with the user in
various situations.

David

>
>  I'm working on an intranet application and I'm
using
>  session beans (Maybe I shouldn't). Right now if the
>  user does a double click. The first request passes
>and the second request populates the bean while the
>first request is been processed ... This is a little
>race :-).
>
>  I don't think Struts offers an easy way to avoid
>  this... maybe I'm wrong ...
>
>  Thanks
>  /David
>
>
>
>
> > David
> > --- David Gagnon <[EMAIL PROTECTED]> wrote:
> > >  Hi all,
> > >
> > >
> > >If you have a session bean and you are using
> > the
> > >  token framework to protect yourself again
> > multiple
> > >  submit...
> > >
> > >
> > >  Let say a request with a bad token is post to
the
> > >  server.  The bean will be populated right ...
> > even
> > >  if
> > >  the token is not valid.  Is struts offers
support
> > > to
> > >  check if a request contains a valid token prior
> > to
> > >  populate the bean.  For what I know you the
> > sooner
> > >  you
> > >  can play with token in struts is in the reset
> > > method
> > >  of the bean (It may not be the best place to
play
> > >  with
> > >  token anyway...).
> > >
> > >
> > >  Is a request with a bad or no token should be
> > >  redirect
> > >  by the framework to a handler.  Like it's done
> > with
> > >  the Exception in Struts?  I think there should
> > have
> > >  a
> > >  way to avoid changing the server state on bad
> > >  request
> > >  ...
> > >
> > >
> > >  My guest is that you already know about all
that
> > > :-)
> > >  ... or that there is something to prevent this
> > that
> > >  I'm not aware of.
> > >
> > >
> > >  Thanks for your help
> > >
> > >
> > >  /Dave
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > __
> > > Do you Yahoo!?
> > > SBC Yahoo! DSL - Now only $29.95 per month!
> > > http://sbc.yahoo.com
> > >
> >
> >
> > __
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
>
>
>
>__
>Do you Yahoo!?
>SBC Yahoo! DSL - Now only $29.95 per month!
>http://sbc.yahoo.com
>
>-
>To unsubscribe, e-mail:
[EMAIL PROTECTED]
>For additional commands, e-mail:
[EMAIL PROTECTED]
>

_
MSN 8 helps eliminate e-mail viruses. Get 2 months
FREE*.  
http://join.msn.com/?page=features/virus


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



__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Re: Token in struts and session bean.... problem with the framework ?

2003-06-17 Thread David Gagnon
 
> >It's up to your Action to call the token methods to
> >validate the token and 
> >forward the user to an appropriate page.
> >
> 
 I know, maybe I wasn't clear enough .. sorry :-) 
What I'm saying is that if you use a
 session bean, the content is modified even though the
token is invalid.. I thinks this should not happen.
 
 I'm working on an intranet application and I'm using
 session beans (Maybe I shouldn't). Right now if the
 user does a double click. The first request passes
and the second request populates the bean while the
first request is been processed ... This is a little
race :-).  
 
 I don't think Struts offers an easy way to avoid
 this... maybe I'm wrong ...
 
 Thanks 
 /David
 
 
 
 
> David
> --- David Gagnon <[EMAIL PROTECTED]> wrote:
> >  Hi all,
> >  
> >   
> >If you have a session bean and you are using
> the
> >  token framework to protect yourself again
> multiple
> >  submit...
> >  
> >   
> >  Let say a request with a bad token is post to the
> >  server.  The bean will be populated right ...
> even
> >  if
> >  the token is not valid.  Is struts offers support
> > to
> >  check if a request contains a valid token prior
> to
> >  populate the bean.  For what I know you the
> sooner
> >  you
> >  can play with token in struts is in the reset
> > method
> >  of the bean (It may not be the best place to play
> >  with
> >  token anyway...).
> >  
> >   
> >  Is a request with a bad or no token should be
> >  redirect
> >  by the framework to a handler.  Like it's done
> with
> >  the Exception in Struts?  I think there should
> have
> >  a
> >  way to avoid changing the server state on bad
> >  request
> >  ...
> >  
> >   
> >  My guest is that you already know about all that
> > :-)
> >  ... or that there is something to prevent this
> that
> >  I'm not aware of.
> >  
> >   
> >  Thanks for your help 
> >  
> >  
> >  /Dave 
> >  
> >   
> >  
> >   
> >  
> >   
> >  
> >  
> > 
> > 
> > 
> > __
> > Do you Yahoo!?
> > SBC Yahoo! DSL - Now only $29.95 per month!
> > http://sbc.yahoo.com
> > 
> 
> 
> __
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com



__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



Token in struts and session bean.... problem with the framework ?

2003-06-17 Thread David Gagnon
 Hi all,
 
  
   If you have a session bean and you are using the
 token framework to protect yourself again multiple
 submit...
 
  
 Let say a request with a bad token is post to the
 server.  The bean will be populated right ... even
 if
 the token is not valid.  Is struts offers support to
 check if a request contains a valid token prior to
 populate the bean.  For what I know you the sooner
 you
 can play with token in struts is in the reset method
 of the bean (It may not be the best place to play
 with
 token anyway...).
 
  
 Is a request with a bad or no token should be
 redirect
 by the framework to a handler.  Like it's done with
 the Exception in Struts?  I think there should have
 a
 way to avoid changing the server state on bad
 request
 ...
 
  
 My guest is that you already know about all that :-)
 ... or that there is something to prevent this that
 I'm not aware of.
 
  
 Thanks for your help 
 
 
 /Dave 
 
  
 
  
 
  
 
 



__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: French Font in PDF (OT)

2003-03-24 Thread David Gagnon
Hi,

Maybe this can help ...

http://www.anassina.com/struts/i18n/i18n.html

/David




> -Original Message-
> From: Yan, Charlene [mailto:[EMAIL PROTECTED]
> Sent: March 24, 2003 11:19 AM
> To: Struts Users Mailing List
> Subject: RE: French Font in PDF (OT)
> 
> Thank you for replying.  I'm not using FOP, so I can't use your
> stylesheet.  Thanks anyway.
> 
> The support guy just emailed me and said that my data bean that I used to
> write the report content needs to use unicode character-set to encode the
> text.  How can I check the character set of my data bean?
> 
> Thanks.
> 
> Charlene
> 
> -Original Message-
> From: Enrico Donelli [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 24, 2003 10:19 AM
> To: Struts Users Mailing List
> Subject: Re: French Font in PDF (OT)
> 
> 
> I had a similar problem with italian, using the FOP transformation.
> I don't know if this can help, but I solved definining in the xsl used
> to create the fo document the entities, like:
> 
>  
> 
> 
>   ]>
> 
> and then using the defined entities .
> 
> Hope it helps.
> 
> Best regards
> Enrico
> 
> 
> Yan, Charlene wrote:
> 
> >All,
> >
> >I use a third party Java library to create PDF report.  Everything works
> fine except that some French products are not displayed correctly.  Please
> look at the following:
> >
> >LSW Product Description in PDF Report:
> >Ce cours, premier d'une s?rie constitu?e de deux parties, permet
> d'acqu?rir les connaissances essentielles ? la planification et ? la mise
> en oeuvre des strat?gies de sauvegarde et de restauration d'une base de
> donn?es. Dans ce cours, les utilisateurs prendront connaissance des
> objectifs de sauvegarde et de restauration et identifieront les fonctions
> des structures et des processus de l'architecture Oracle. Ils apprendront
> ?galement ? g?rer le processus d'archivage et ? mettre ? jour un catalogue
> de restauration. Ce cours pr?sente ?galement les concepts li?s ?
> l'ex?cution de sauvegardes physiques avec ou sans l'utilitaire Recovery
> Manager (RMAN).
> >
> >LSW Product Description:  
> >Ce cours, premier d'une série constituée de deux parties, permet
> d'acquérir les connaissances essentielles à la planification et à la mise
> en oeuvre des stratégies de sauvegarde et de restauration d'une base de
> données. Dans ce cours, les utilisateurs prendront connaissance des
> objectifs de sauvegarde et de restauration et identifieront les fonctions
> des structures et des processus de l'architecture Oracle. Ils apprendront
> également à gérer le processus d'archivage et à mettre à jour un catalogue
> de restauration. Ce cours présente également les concepts liés à
> l'exécution de sauvegardes physiques avec ou sans l'utilitaire Recovery
> Manager (RMAN).
> >
> >I know we have a lot of French users on the list.  The third party lib
> user guides says that it supports Western European language.  I', still
> investigating it.  I may have to specify a TrueType font that can display
> both English and French.  I don't know and have never used/typed any
> French words.  Any insights on this?  TIA!
> >
> >Charlene
> >
> >-
> >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]
> 
> 




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



RE: ActionError not supporting bundle

2003-03-20 Thread David Gagnon
Hi,

  Honestly I haven't try a solution yet .. just a lack of time.  I had a
chat with a guy on the list his workaround was to put all bundle in the main
bundle at boot time (means he was keeping all his bundle files but was
merging them dynamically).

  For me it seems pretty clear that ActionError should support specifying
bundle since it's when you specify a key that you know where this key is
coming from.

  I'll try to dig a solution on my own during next week and let know my
solution as well.

  Just one question left .. is this limitation just because someone forgot
about it ... or because havin ActionError supporting bundle is much more
complicated than what I think right now ?

Anyway thanks for your help ... 

/David

  

> I am also in the same boat, buddy.
> 
> I am trying wuite a few things. Will let you know about the progress.
> Struts Config do take multiple message resources. You can use them also in
> diff Action files.
> 
> But with validations, i am not so sure.
> No doubt, it is huge limitaiton if Struts won't be able to support
> multiple
> message resources for validators.
> 
> regards
> navjot singh
> 
> - Original Message -
> From: "David Gagnon" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, March 19, 2003 9:04 PM
> Subject: ActionError not supporting bundle
> 
> 
> | Hi all,
> |
> |   I look into the RC1 code to find that ActionError
> | doesn't allow to specify the bundle to search for a
> | given error message.
> |
> |   I my application I have multiple modules and
> | multiple message ressource files.  How can I specify
> | error messages coming from different bundles?
> |
> | The Errors Tag doesn't support to specify a bundle
> | too.
> |
> | I initially got this problem in validator. I put my
> | generic error messages in the base message resource
> | file and the column name in a specific module.
> |
> | So I guess you are already aware of the problem ... it
> | seem to be a big limitation if I want to use multiple
> | resource files :-/
> |
> | I just want to know if this is planned to be fixed in
> | Struts 1.1?
> |
> | If not I suppose the only work around is to use only
> | one property file ... for the whole application ...
> | but that gone be a huge file ... is that a problem.
> |
> | Do you have any solution I haven't think of ?
> |
> | Thanks for your help !
> | Best Regards
> | /David
> |
> |
> |
> |
> |
> 
> 
> -
> 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: ActionError not supporting bundle

2003-03-19 Thread David Gagnon
Hi 

Thanks for your reply btw :-)

> >   I look into the RC1 code to find that ActionError
> > doesn't allow to specify the bundle to search for a
> > given error message.
> >
> >   I my application I have multiple modules and
> > multiple message ressource files.  How can I specify
> > error messages coming from different bundles?
> 
> The module selection is handled for you.  ActionError is a simple bean
> used to carry a message or error (key and args) to the view.
> You would specify the bundle you want as an attribute of the errors tag
> or messages tag.

I know the JSP errors tag allows to specify the bundle ... the problem is
that the errors to display may come from different bundles.  Per example, in
the validate Method of an ActionForm you may have:

if (f1 == null) 
errors.add("f1", new ActionError( "bundle1.f1.notEmpty"));

if (f2 == null)
errors.add("f2", new ActionError( "bundle2.f2.notEmpty"));

where bundle1.f1.notEmpty comes from "bundle1" and bundle2.f2.notEmpty comes
from "bundle2".

This case will occur if you have a base bundle where you put your general
messages and a module specific bundle where you put stuff specific to your
module.

And in the JSP you can only specify one bundle... so you got a problem.


In validator it's the same problem: 
You have basic messages used by the different validators and most of those
messages take an argument which is the name of the field that is validated.

So my basic messages are in the main bundle and the field names are in the
module specific bundle.  The result is that I can't have the field name
appear on the screen.


Hope it's more clear .. if not tell me :-)

Thanks again
/David

> 
> 
> 
> > The Errors Tag doesn't support to specify a bundle
> > too.
> 
> Are you sure about that?
> http://jakarta.apache.org/struts/userGuide/struts-html.html#errors
> 
> 
> > I initially got this problem in validator. I put my
> > generic error messages in the base message resource
> > file and the column name in a specific module.
> 
> Sorry, I can't help you with the Validator, that's not my specialty.
> 
> --
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.open-tools.org
> 
> 
> 
> 
> -
> 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: SQL statement generator for a web based list

2003-03-19 Thread David Gagnon
Hi all,

 

  Sorry to bug the list for that .. I looked around and haven't found my
answer . and pretty sure you guys had this problem already.

 

  My web application support lists.  Searches on the list can be done by
specifying several parameters .. like ID, Country, name .. whatever.  From
those parameters I must craft an sql statement on the fly to fetch the info
from the db.  

 

  Is there a framework that I can help me in this task . I did it myselft ..
work well . but the result code is complex .. I think an adapted framework
will help simplying the problem.

 

Thanks

/David



ActionError not supporting bundle

2003-03-19 Thread David Gagnon
Hi all,
 
  I look into the RC1 code to find that ActionError
doesn't allow to specify the bundle to search for a
given error message.
 
  I my application I have multiple modules and
multiple message ressource files.  How can I specify
error messages coming from different bundles?
 
The Errors Tag doesn't support to specify a bundle
too.
 
I initially got this problem in validator. I put my
generic error messages in the base message resource
file and the column name in a specific module.
 
So I guess you are already aware of the problem ... it
seem to be a big limitation if I want to use multiple
resource files :-/
 
I just want to know if this is planned to be fixed in
Struts 1.1?
 
If not I suppose the only work around is to use only
one property file ... for the whole application ...
but that gone be a huge file ... is that a problem.
 
Do you have any solution I haven't think of ?
 
Thanks for your help !
Best Regards 
/David