[struts faces] How do i set default values?

2007-03-13 Thread David Delbecq
Hello,

i am trying to convert some struts form to be JSf compatible using
struts faces. However, there are a few problems with initialization for
form.

I have this:
html:form action=/search.do acceptCharset=UTF-8 styleClass=search
html:hidden property=scope value=${param.searchScope}/
html:hidden property=requestedNodeResults value=15/



According to struts faces docs, i need to use the corresponding JSF tag:
h:inputHidden id=scope value=#{myForm.scope}/
h:inputHidden id=requestedNodeResultas
value=#{myForm.requestedNodeResults}/

However, you all can guess my problem, where do i put the 2 default
values for form: '${param.searchScope}' and '15'

According to myfaces mailing list, i should do this in the managed bean
definition. However, there is no managed bean definition in struts faces.

Any suggestion? What am trying to do is incorporate existing struts
forms inside a JSF page. We would like to avoind a immediate complete
rewrite and have a temporary migration solution...

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



Re: Upload huge file size: The page cannot be displayed browser er

2006-08-31 Thread David Delbecq
Are there any exceptions of any sort in console? What size is the file?
Raghuveer a écrit :
  have an upload file operation in the web application.  The web server is
 OC4J.

 //UploadForm.jsp
 FORM NAME=InputForm ACTION=UploadAction.jsp METHOD=POST
 enctype=multipart/form-data
 input type=file name=fileName
 //etc ...
 /FORM

 After I deploy the application to the web server, if I upload a small file
 size, it is fine.

 But if i upload huge data ,data is uploading but if any action button is
 clicked
 After 30 seconds, it has error The page cannot be displayed shown on the
 web browser.


 -
 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: Creating new Session without invalidating the old one

2006-08-29 Thread David Delbecq
It's tricky to force a new session, and most of time depend on the
container.
Since you want to keep a few datas of your session, i'll recommend you
try using

Enumeration HttpSession.getAttributeNames()
HttpSession.removeAttribute(String name)

[EMAIL PROTECTED] a écrit :
 Hello!

 Is it possible to create a new session for an already logged in person (which
 has an actual session) without invalidating the existing session? It's 
 necessary
 for me to have the old session before creating an additional one, because I 
 have
 to get few datas from the old session for the new one.

 request.getSession(true) gives a new session, but only if the user doesn't 
 have
 an existing session.


 Any hints?
 Kind regards,
 Andreas Hartmann


 -
 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] Re: Abdel est en vacance!

2006-08-28 Thread David Delbecq
La chasse au caribou est ouverte!

** _
| \ V  |/ /| | / /|
|  \   V / | |/ / |
|   \   /_ | V /  |
|| | \\|  /   |
|| |  \  ||
|| \ ||
|\| |/|
| |  __ __  | |
| | /. \   /. \ | |
| | \__/   \__/ | |
| | | |
| | | |
| | | |
|  \   /  |
|   \ /   |
|\   / \  |
| \ /   \ |
|  \___/ \|
|   \ /\  \   |
|V|**

note: ascii art from caribouteries 
(http://bram.bertrand.free.fr/CaribouteriesV.html)
Romu a écrit :
 bon ben bonnes vacances  !

 Le 28/08/06, [EMAIL PROTECTED] [EMAIL PROTECTED] a écrit :


 Je serai absent(e) du  28/08/2006 au 11/09/2006.

 Je suis absent pour le moment, et je répondrai à votre message dès mon
 retour.
 merci



 **

 La présente communication (et tout fichier rattaché) s'adresse
 uniquement
 au(x) destinataire(s) précité(s) et ne peut être autrement distribuée,
 copiée ou utilisée.  Le contenu de cette communication peut être
 assujetti
 au privilège du secret professionnel.  Tout droit à ce privilège est
 expressément revendiqué et nullement abandonné.  Si vous avez reçu cette
 communication par erreur, veuillez nous en avertir immédiatement en
 répondant à ce courriel ou en nous appelant.  Veuillez également effacer
 cette communication (et tout fichier rattaché) sans en conserver une
 copie.
 Merci.

 ***

 This communication (and any attachments) is directed in confidence to
 the
 addressee(s) listed above, and may not otherwise be distributed,
 copied or
 used.  The contents of this communication may also be subject to
 lawyer-client privilege, and all rights to that privilege are expressly
 claimed and not waived.  If you have received this communication in
 error,
 please notify us by reply e-mail or by telephone and delete this
 communication (and any attachments) without making a copy.  Thank you.




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



Re: How to create custom tag

2006-07-17 Thread David Delbecq

Use expression language available in jsp 2.0:
div 
class=${theBean.messageLevel=Error?ErrorClass:theBean.messageLevel=Warning?WarningClass:InfoClass}

.
/div

Pankaj Gupta wrote:
I dont think CSS can work in this case as the CSS would be static. I 
want to display color of the font based on the value of severity of 
message i.e. if the message is critical it should be displayed in red, 
info in blue, etc. i.e. It would depend on the value of a form bean 
property.


Li wrote:

why not use CSS?

On 7/17/06, Pankaj Gupta [EMAIL PROTECTED] wrote:


Hi All,

I want to create a custom tag which wraps the plain html font tag in
such a way that it fetches the color of the font to be displayed on a
pre-configured severity level. Can anyone pl suggest how can I do that.

regards,
Pankaj

-
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: Struts Action + Multiple Request

2006-07-13 Thread David Delbecq
RODRIGUES DE ALMEIDA Thiago wrote:
 Hi All,
 I have this scenario:

 In my application, the user has the possibility of openning multiple
 windows (browser) simutaneously.
 In this case, each new window makes requests for data thru a struts
 action.

 That means, one user can make multiple requests to the servlet container
 (Tomcat 5.5) at the same time.
   
No problem there, this is made for it and, unless you use something else
than request scope bean for your struts action, it shouldn't be a
problem for struts too.
 The problem i have is concerning the performance.
 Since the user has oppened more than 4 windows, the browser (IE 6)
 becomes freezed.

 I have taken a look into the server and apparently there are no problems
 of memory or processor.
 For the Tomcat side, i did not see any disturbing problem concerning
 performance.

 What would you recommend as solutions for this kind of scenario ?
   
Dump the Threads of your jvm, you might simply be in a deadlock with
your application.
 Thanks in advance,

 Thiago de Almeida


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



[Shale] some questions regarding dialogs and subdialogs

2006-07-11 Thread David Delbecq

Hello all,

Recently, i decided to play a bit with shale.  I began to write some 
tests jsp to play with it. I came across various problems/interrogations:


1) considering the following dialog configuration, and the following 
jsps  (see bottom of email), i am supposed to have one main dialog, with 
a button starting a subdialog to edit one specific value.
More precisely, the backing bean of  main dialog is a property bean 
which gets modified by the subdialog. I can start the dialog ok with  
h:commandLink value=start... action=dialog:Test Dialog/, i enter 
the subdialog when i click the appropriate button in testMain.faces but 
i am stuck in the subdialog. I never return from it. Did i miss 
something in the way a dialog is supposed to end? There is no message in 
console to help and in subdialog i click on an action which's outcome 
should direct to and exit ... of subdialog.


2) I plan in an app to have the following structure:
- have a 'main' dialog present some forms to the user to edit a bean X 
containing some properties.
- amongst properties of X there is a collection of element Y, those 
elements are complex beans which will be presented read-only
- i need, next to those elements Y to put a button starting a subdialog 
for edition of Y.

- How do i pass the element Y as a parameter to the subdialog for edition?
- Will the content of my main dialog be preserved during the run of 
subdialog?


3) While testing, i noticed if i start dialog A by clicking on an action 
'dialog:A', enter a subdialog B, redeploy the webapp, click again on 
action 'dialog:A', i get exceptions in console telling me You have 
requested a transition outcome named dialog:A from a state named 
 in a dialog named B, but no transition definition can be 
found.  Double check the spelling of the transition outcome name. To 
circumvent this problem i need to remove my jsessionId cookie, reload 
the page containg the link to action, and the i can start dialog:A. Why 
isn't dialog: always assumed as an attempt to start a new dialog and 
drop currently running one?


4) is there a way to start a dialog process or create a link to a JSF 
page without ressorting to a h:formh:commandLink... construction? 
(like http://?action=dialog: or 
http:///userDetails.faces?username=), all this to prevent the 
use of javascript when possible and allow the sending of direct link to 
some JSF content by email.



Greetings,
David Delbecq



dialog-config.xml:
!DOCTYPE dialogs PUBLIC
 -//Apache Software Foundation//DTD Shale Dialog Configuration 1.0//EN
 http://struts.apache.org/dtds/shale-dialog-config_1_0.dtd;

dialogs

   dialog name=Test Dialog start=Edit Values
   view name=Edit Values viewId=/rmi/testMain.jsp
   transition outcome=main target=Edit Values/
   transition outcome=sub target=Edit Subdialog/   
   /view

   subdialog name=Edit Subdialog dialogName=Sub Dialog
   transition outcome=done target=Edit Values/
   /subdialog
   /dialog
  
   dialog name=Sub Dialog start=Edit Sub

   view name=Edit Sub viewId=/rmi/testSub.jsp
   transition outcome=done target=Exit /
   /view
   end name=Exit viewId=/rmi/testMain.jsp/
   /dialog
/dialogs





testMain.jsp
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
%@ taglib uri=http://java.sun.com/jsf/core; prefix=f%
%@ taglib uri=http://java.sun.com/jsf/html; prefix=h%
f:view
 html
   body
h:form id=testForm
   h:outputText value=val1:/
h:inputText value=#{testBean.val1}/
h:inputText value=#{testBean.val2}/
h:inputText value=#{testBean.val3}/
   h:commandButton action=main value=Say Hello/br/
   h:outputText value=#{testBean.content.name}/
   h:commandButton action=sub value=Edit.../
/h:form
   /body
 /html
/f:view


testSub.jsp
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
%@ taglib uri=http://java.sun.com/jsf/core; prefix=f%
%@ taglib uri=http://java.sun.com/jsf/html; prefix=h%
f:view
 html
   body
h:form id=testForm
   h:outputText value=sub value:/
h:inputText value=#{testBean.content.name}/
   h:commandButton action=done value=finish/
/h:form
   /body
 /html
/f:view

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



Re: how to start ajax in dwr

2006-07-04 Thread David Delbecq

The dwr website is full of examples and documentations

Gomathi wrote:

Hi i am new to ajax.I dont know dwr how to use dwr.
.Is there is any sample site for creating ajax application using dwr.
Kindly Regards
gomes

  



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



Re: [shale][clay] NullPointerException on Linux

2006-07-04 Thread David Delbecq
Upper/lower case mistake in filename most probably, that's about the 
main difference between windows and linux, the windows filesystem is 
case insensitive.

Ian.Priest wrote:

Anyone want to hazard a guess as to why I get the npe below when I
deploy my application on Linux in tomcat 5?
I'd just upgraded shale and clay to the latest snapshot of 1.0.3 and
myfaces to 1.1.3. The same war file deploys and runs happily on my
windows development box running tomcat 5.5.12.
 
2006-07-04 13:10:36,446 ERROR

[org.apache.shale.clay.parser.builder.BuilderFactory]
java.lang.NullPointerException
2006-07-04 13:10:36,447 ERROR
[org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/scn].[f
aces]] Servlet.service() for servlet faces threw exception
java.lang.RuntimeException: java.lang.NullPointerException
at
org.apache.shale.clay.parser.builder.BuilderFactory.getRenderer(BuilderF
actory.java:115)
at org.apache.shale.clay.parser.Node.getBuilder(Node.java:239)
at
org.apache.shale.clay.config.ClayTemplateParser.generateElement(ClayTemp
lateParser.java:126)
at
org.apache.shale.clay.config.ClayTemplateParser.loadConfigFile(ClayTempl
ateParser.java:89)
...lines snipped...
Caused by: java.lang.NullPointerException
at
org.apache.shale.clay.parser.builder.BuilderFactory.getRenderer(BuilderF
actory.java:111)
... 48 more
 

  



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



Re: Quick question about the Resources.properties files.

2006-06-30 Thread David Delbecq

Did you do
input type=button .. value=bean:message key='blabla'/  which 
make sense in a JSP, or did you do
html:button .. value=bean:message key='blabla'/ which is a non 
sense as  a you can't put a jsp tag inside a parameter of a jsp tag.


if you use html:button, use this way
html:button ..bean:message key='blabla'/html:button

Fredrik Andersson wrote:

Hi all

I'm still implementing the i18n internationalization on the page and now
I have noticed that my buttons don't behave as expected. When I change
my values of buttons to value=bean:message key='blabla' I get
the bean:message tag as the text on the button.

How is this supposed to be solved? I coud make an ugly solution with an
if statement inside jsp code and generate different buttons that way but
it feels wrong.

-
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: Fwd: [OT] How to specify classpath for an application

2006-06-28 Thread David Delbecq
It's rather not possible in general, The .war is supposed to be a 
'complete' application, config included. If you load the ressources 
using the classloader, you can still use 'tricks' that depend on 
container specific behaviour, but that is not recommanded.


The best way if you want your user not to have to play thmeself with 
.war content is to provide a ant script that will take a config/ 
directory and inject it in the .war, so the user easily regenerate the 
war avec config change.



Pankaj Gupta wrote:

-- Forwarded message --
From: Pankaj Gupta [EMAIL PROTECTED]
Date: Jun 28, 2006 11:03 AM
Subject: [OT] How to specify classpath for an application
To: user@struts.apache.org

Hi All,

I want to specify a config folder in my classpath which will not be 
part of

my war file. Can you please suggest how can I do that? I want to place my
config files outside the war file for anyone to modify it.

regards,
Pankaj




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



Re: message resources

2006-06-08 Thread David Delbecq

bean:message key= myValueAdded  arg0=${mybean.value}/
Marcus wrote:

Pass the argument {0} as follows:



bean:message key= myValueAdded  arg0=value/



I tried that,
but then it writes literally:

Value value has been added.

But what need the VALUE of hte variable myValue to be printed.
:-(

Marcus

-
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: message resources

2006-06-08 Thread David Delbecq

Marcus wrote:

 bean:message key=myValueAdded arg0=${mybean.value}/

I wrote:
bean:message key=myValueAdded arg0=${myDynaForm.value}/

And it returns literally:
${myDynaForm.value}


Sorry, thought bean:message was supporting el notation :)

try this

bean:message key=myValueAdded arg0=%=myDynaForm.getValue() %/

It's awfull, but assuming you have myDynaForm in some scope should work

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



Re: Image Buttons in IE

2006-06-06 Thread David Delbecq

Hi,

indeed ie does not support properly the value of a button html tag. It 
does send the html-stripped content of button instead of it's value.  
The best solutions it to add a

onClick=someScriptToSetHiddenField(action,add);

http://www.jguru.com/faq/view.jsp?EID=897290

marcus biel (innoWake gmbh) wrote:

Hi,

I've got 2 image buttons, they work great in firefox.
Internet Explorer doesn't seem to support the
value tag - and therefor I get submitted an empty String.

html:image property=action value=add src=add.gif/
html:image property=action value=remove src=remove.gif//td

Any idea, how I could get this to run for Internet Explorer?
(I think I found a solution for regular forms, but I am using a
DynaActionForm...)


Marcus


-
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: Extracting MessageResources from Struts

2006-04-24 Thread David Delbecq
Using message ressources is not struts specific. What struts does beside
using message ressources is maintaining the user language in user http
session and use it when it need a message ressouce use. If all you need
to do is have multi language support for your messages, i suggest you
take a look at how ressource bundles are used for i18n in the sun java
documentations http://java.sun.com/docs/books/tutorial/i18n/index.html

Please note basically the MessageResources is a front end to this
allowing configuration of ressources in struts xml configuration file.

Julian Tillmann a écrit :

Hi everyone, 

this question is not entirely a question about struts but just about a part
of it, which I would like to extract 
from the rest of the framework. It's like this: 
I have my own framework for creating dynamic SVGs and in one Class I
have tooltip-messages hardcoded in German. I don't want to destroy the
structure of the method-calls
and so I thought about Struts 
MessageResources where I can use different language packages in form
of property files. So far so good, 
but I don't want to add the whole struts to my framework but just the
MessageRessources-part and so my question is:
can I just extract the MessageResources.class or is there substitution
I can use for this? 

thanks very much in advance
Julian

  



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



Re: Class that listens is app alive

2006-04-20 Thread David Delbecq
Either use the init/destroy methods of a servlet filter
Either create a servlet with a load-on-startup  value

Note: you will only know the webapp is being stopped / started, you will
get no information about whether it is a redeploy or a simple tomcat
shutdown/start

Stanislav a écrit :

Hi!

I have class that implements HttpSessionBindingListener and that class 
listens all session in app.
My question is: is there any way to listen app? I have some thing to do if app 
is being redeployed?
How can i do that?

Tnx,
Stanislav

-
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: I apologize for maintaining human standards

2006-03-28 Thread David Delbecq
Quinn Stone a écrit :

 
I think maybe we should have user for users, dev for developers, and a new
ego for those that want to have pissing contests. Speaking of saturation...
 
Q

  

+1

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



Re: [IE Crashes]

2006-03-28 Thread David Delbecq
for Moz, you can go to the mozilla bugtrack to get a list of existing
browser bugs.
For ie, you might need to get the releas note of each ie patch released
by microsoft.

There is no maximum size supported by browser. However, the most you put
in the html, the slowest browsr will be at the rendering and the most
memory it will require. As an example, we have a web application here
which can output a full server history. This is about a 10M html file
with lots of table. IE took about 30 minute render it, moz about 3
minutes. In general, i'll recommend outputing a page, not a book :)


Deva Pitchai(NatureSoft) a écrit :

 Hi group...

 Any idea at which stage, will the browser(IE or Moz) crashes when
 handling a jsp application.

 how many lines a browser can handle, without a crash?

 is there any limitation of the web page size?

 any thoughts appreciated.



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



Re: Regards ajax

2006-03-23 Thread David Delbecq
Take a look at the dwr framework. It allows you to easily map server
object request to local forms / div
It's prety easy to use, and convert server dwr exposed objects to
javascript object, with similar method names. It pretty looks from
javascript point of view like having an asynchronous version of the
server object available locally :)

gomathi a écrit :

Hi 
I want to use ajax in my java application.How to use it.
Any samples for one  jsp page that contains some fields.
Kindly Regards
gomes


-
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: struts security

2006-03-14 Thread David Delbecq
Do it like you would for any servlet. Either apply a security constraint
to struts servlet itself or apply security constraints to url path
(applying a security constraint to /admin/* applies also to
/admin/someStrutsAction.do)

Jubin Kuriakose a écrit :

Hi all
Can ayone give me links related to implemnting security-contraints(from
web.xml) and struts together. I googled without any success.

thnx jubs

  



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



Re: struts security

2006-03-14 Thread David Delbecq
Am sorry but that's not how form based authentification works in j2ee.
We you are not authenticated, the container redirects your to
form-login-page
This page must contain a form with 2 fields :   j_username and
j_password. The form action MUST be of type POST and the target MUST be
j_security_check (this is a special url that will be handled by
container, you can not map any servlet there).

example:
 form method=POST action=j_security_check
 table
 tr
 tdLogin :/td
 tdinput type=text name=j_username/td
 /tr
 tr
 tdMot de passe :/td
 tdinput type=password name=j_password/td
 /tr
 tr
 tdinput type=submit value=Entrer !/td
 tdinput type=reset value=Annuler/td
 /tr
 /table
 /form

if you use any action other than  j_security_check, this will be handled
like any other url query, and no authentification will take place.

The reason you are having father - login form - father apparently
working, is simply because struts does a forward after action, which
take place internally and so is not concerned about the security
constraints.

Jubin Kuriakose a écrit :

Hi David
I did do that ...

  

security-constraint
web-resource-collection
web-resource-namefather/web-resource-name
descriptionSecurity/description
url-pattern/father/*/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection

auth-constraint
role-nameadmin/role-name
/auth-constraint

user-data-constraint
transport-guaranteeNONE/transport-guarantee
/user-data-constraint

/security-constraint

login-config
auth-methodFORM/auth-method
form-login-config
form-login-page/auth.do/form-login-page
form-error-page/admin/error.jsp/form-error-page
/form-login-config
/login-config

security-role
role-nameadmin/role-name
/security-role


and my authentication is diverted to an action class which carries out the


actual checking.

Here is auth.jsp that calls the AuthAction


html:form action=authAction
  

TABLE width=100% border=0 cellspacing=0 cellpadding=5
TR align=center
TD align=right class=Prompt/TD
TD align=left
html:text property=j_username
maxlength=20/html:text
/TD
/TR
TR align=center
TD align=right class=PromptUsername/TD
TD align=left
html:text property=j_password
maxlength=20/html:textBR
/TD
/TR
TR align=center
TD align=right class=PromptPassword/TD
TD align=left
html:submit value=Login/html:submit
/TD
/TR
/TABLE
/html:form




the action class is here

public ActionForward execute(ActionMapping mapping, ActionForm form,
  

HttpServletRequest request, HttpServletResponse response) throws Exception {

String username = ((DynaActionForm)form).getString(j_username);
String password = ((DynaActionForm)form).getString(j_password);
System.out.println(Authentication execute called);
try {

SecurityAssociationHandler handler = new
SecurityAssociationHandler();
SimplePrincipal user = new SimplePrincipal(username);
handler.setSecurityInfo(user, password.toCharArray());
LoginContext loginContext = new LoginContext(example,
(CallbackHandler) handler);
loginContext.login();
Subject subject = loginContext.getSubject();
System.out.println(Subject--  + subject.toString());
SetPrincipal principals = subject.getPrincipals();
principals.add(user);

request.getSession(false).setAttribute(login,subject);
} catch (LoginException e) {
// TODO: handle exception
System.out.println(LoginException);
return mapping.findForward(error);
}
return mapping.findForward(father);
}





and it works fine. Each time a request comes to url  /father/* the
auth.jspis called, even if I was authorised the first time.
Meaning I have to authenticate myself every  time I acess anything in
/father/ . how do i get over this behaviour and only authenticate my self
only once...

thnks for any help



On 3/14/06, David Delbecq [EMAIL PROTECTED] wrote:
  

Do it like you would for any servlet. Either apply a security constraint
to struts servlet itself or apply security constraints to url path
(applying a security constraint to /admin/* applies also to
/admin/someStrutsAction.do)

Jubin Kuriakose a écrit :



Hi all
Can ayone give me links related to implemnting security-contraints(from
web.xml) and struts together. I googled without any success.

thnx jubs



  

-
To unsubscribe

Re: struts security

2006-03-14 Thread David Delbecq
Jubin Kuriakose a écrit :

oh...
Supposing i did use j_security_check to authenticate. how do i check if the
user is authenticated at a later stage 

request.getUserPrincipal() returns a non-null value

and is it possible to programmitically remove his permission.
  

Not really. Once user has been authenticated it's written in his
session. Some people have had success by clearing the user session, but
this behaviour is container dependent as, unfortunatly, j2ee specs did
not provide for such a mechanism.

thnx

On 3/14/06, David Delbecq [EMAIL PROTECTED] wrote:
  

Am sorry but that's not how form based authentification works in j2ee.
We you are not authenticated, the container redirects your to
form-login-page
This page must contain a form with 2 fields :   j_username and
j_password. The form action MUST be of type POST and the target MUST be
j_security_check (this is a special url that will be handled by
container, you can not map any servlet there).

example:
form method=POST action=j_security_check
table
tr
tdLogin :/td
tdinput type=text name=j_username/td
/tr
tr
tdMot de passe :/td
tdinput type=password name=j_password/td
/tr
tr
tdinput type=submit value=Entrer !/td
tdinput type=reset value=Annuler/td
/tr
/table
/form

if you use any action other than  j_security_check, this will be handled
like any other url query, and no authentification will take place.

The reason you are having father - login form - father apparently
working, is simply because struts does a forward after action, which
take place internally and so is not concerned about the security
constraints.

Jubin Kuriakose a écrit :



Hi David
I did do that ...



  

   security-constraint
   web-resource-collection
   web-resource-namefather/web-resource-name
   descriptionSecurity/description
   url-pattern/father/*/url-pattern
   http-methodGET/http-method
   http-methodPOST/http-method
   /web-resource-collection

   auth-constraint
   role-nameadmin/role-name
   /auth-constraint

   user-data-constraint
   transport-guaranteeNONE/transport-guarantee
   /user-data-constraint

   /security-constraint

   login-config
   auth-methodFORM/auth-method
   form-login-config
   form-login-page/auth.do/form-login-page
   form-error-page/admin/error.jsp/form-error-page
   /form-login-config
   /login-config

   security-role
   role-nameadmin/role-name
   /security-role


and my authentication is diverted to an action class which carries out


the




actual checking.

Here is auth.jsp that calls the AuthAction


   html:form action=authAction


  

   TABLE width=100% border=0 cellspacing=0 cellpadding=5
   TR align=center
   TD align=right class=Prompt/TD
   TD align=left
   html:text property=j_username
maxlength=20/html:text
   /TD
   /TR
   TR align=center
   TD align=right class=PromptUsername/TD
   TD align=left
   html:text property=j_password
maxlength=20/html:textBR
   /TD
   /TR
   TR align=center
   TD align=right class=PromptPassword/TD
   TD align=left
   html:submit value=Login/html:submit
   /TD
   /TR
   /TABLE
   /html:form





the action class is here

public ActionForward execute(ActionMapping mapping, ActionForm form,


  

HttpServletRequest request, HttpServletResponse response) throws


Exception {


   String username =


((DynaActionForm)form).getString(j_username);


   String password =


((DynaActionForm)form).getString(j_password);


   System.out.println(Authentication execute called);
   try {

   SecurityAssociationHandler handler = new
SecurityAssociationHandler();
   SimplePrincipal user = new SimplePrincipal(username);
   handler.setSecurityInfo(user, password.toCharArray());
   LoginContext loginContext = new LoginContext(example,
   (CallbackHandler) handler);
   loginContext.login();
   Subject subject = loginContext.getSubject();
   System.out.println(Subject--  + subject.toString());
   SetPrincipal principals = subject.getPrincipals();
   principals.add(user);

   request.getSession(false).setAttribute(login,subject);
   } catch (LoginException e) {
   // TODO: handle exception
   System.out.println(LoginException);
   return mapping.findForward(error);
   }
   return mapping.findForward(father);
   }






and it works fine. Each time a request comes to url  /father/* the
auth.jspis called, even if I was authorised the first time.
Meaning I have to authenticate myself every  time I acess anything in
/father/ . how do i get over this behaviour and only authenticate my self
only once

Re: bean:write will not recognize \n or \t

2006-03-10 Thread David Delbecq
Krishna, Mattam (M.) a écrit :

I have the following code in jsp.
html:textarea name=empOtherDevFocusBO cols=512 rows=3
property=focusText /
Here I am enterd the following text:
Test
   Test.
Note:I typed Test and then enter key then tab then Test.
After I submit the html:form , it stores the value perfectly in DB.
After when I tried to display that value by using bean:write it won't
recognize the \n and \t.
  

bean:write output the specified property value in the jspwriter. Not
less, not more. If your property has a linefeed and a tab, they will be
outputed to jspwriter.

Simply it display the value as follows: Test Test
  

Which is the correct display for

Test
Test

in a browser. (linefeed and tab are space separatator. To break a line
in html, use br/ or p/

But actually required is  :
Test
   Test 
I think this is due to bean:write will not recognize the \n and \t.
  

bean:write does no operations on your property other than formatting it
if a format is need (like dates and numbers), if you want your display
in a browser, you should output

preTest
Test/pre

But I want to display the values as user enters.
Is there any other solutions.

Thanks and Regards,
Krishna Mattam
Team Member - CDF Toolset
Contact:044-22548575
Email: [EMAIL PROTECTED]



 mailto:[EMAIL PROTECTED] 



  



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



[FRIDAY] Ouftil Adrach struck again, but i don't care because of bifff

2006-03-10 Thread David Delbecq
It's friday,

Ouftil Adrach (local belgian goddess) struck again. It's raining hard
outside and i will need to get out and catch the train that will lead me
back to week-end. I want to mention the Brussels international fantastic
film festival has started today and i will be there all saturday
evening, that why i don't care about the rain. Long life to the
festival!!! Be there saturday night, don't miss this one!

Mmm have to leave you, the Kofyt Ijd god reclaims me.

This post is mostly Out of Topic, but it's Friday. Wanna flame? Will
trash everything on monday anyway :)

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



Re: File download

2006-03-08 Thread David Delbecq
If i remember well there are special http header that can be used to
tell client the response is split in several part. This is mainly used
when you send a partial response to client (like a html with table
containing 3 rows) and after process advanced you send a more complete
response (like the same html but with table containing 10 rows) and so
on. You could try a 'file then redirect'  construction.  That may be
worth investigations. See HTTP rfc for informations.

Madhav Bhargava a écrit :

Hi All,

I have a JSP where if a link is clicked then a Save As dialog box is
invoked. If the user chooses to save the file, then on the successful
completion of the file download i need to update a status in the database.
After the status is updated the page from which the Save As dialog box was
invoked has to be refreshed with the new status.

When i invoke a dialog box i use ServletOutputStream and context-disposition
to bring up the dialog box. At the end when i write to the servlet output
stream the response is commited. This means that i will not be able to
automatically refresh the page from which the dialog box was invoked.

Please help me with a solution where in i can capture the status of the
download and make a call to the action to referesh the JSP and the database
with the download status.

--madhav

--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

  



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



Re: query parameters

2006-03-07 Thread David Delbecq
Encoding and decoding of query parameters is the job of container
(tomcat, jboss, websphere, what ever you are using). The only struts
related exception is for multipart/form-data (used for file uploads).
There it's common-fileupload library which does the decoding. Why would
you want to do the decoding yourself? The decoding/encoding process is
done according to rfc1630 specifications.

Madhav Bhargava a écrit :

Hi All,

It is a common practice to encode special characters such as ' ', %, #, :, $
etc.. when sending parameters in the query string along with the URL. We
have a similar requirement. Some of the query parameters can contain special
characters and therefore we went for UTf-8 encoding.

Before using the encoded parameters we call request.getParameter() in the
struts action class, decode these parameters and then do any further
processing. The problem comes when % is a part of the parameter value. For
instance the drugName parameter contains a value *pan% jon%. *This gets
encoded into *pan%25+jon%25*. The problem comes when we say
request.getParameter() in the action class. The value we get is already
decoded to *pan% jon%. *So now when we run the decoder it throws an
exception.

*How do i stop the automatic decoding of query parameters and do decoding of
all the query parameters explicitely? *


Madhav


--
When I tell the truth, it is not for the sake of convincing those who do not
know it, but for the sake of defending those that do

  



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



Re: Cannot find bean in scope Problem

2006-02-24 Thread David Delbecq
I bet a box of chocolates you forgot to define or badly defined the
logic taglib in your .jsp header :)

[EMAIL PROTECTED] a écrit :

Hi, 

I have a form with a List and want to show the values on my JSP. But when I
start my JSP the bean id cannot be found in any scopy. I dont understand
why struts is looking for a bean id this is only my id value of the
iterate tag of my JSP. Here is my JSP code:

table
 logic:iterate name=chooseFormIDForm id=id property=forms
type=de.FVKN.FormBean scope=session
   tr align=left
td
html:text name=id property=formID /
/td
td
   html:text name=id property=formkey /
 /td
   /tr
 /logic:iterate
/table

-chooseFormIDForm is the name of my Form
-the id is my variable for iterating over my List
-the property forms is my List with the FormBean Objekts inside

Why do I get cannot find bean id in any scope Error?

Hope anyone can help because I looking for hours for a solution :-(

Thanks for your help.

  



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



Re: How to inject code between HEAD /HEAD of a generated page ?

2006-02-23 Thread David Delbecq
The JSP writer writes http response, not html response. You can use jsp
to generate html, txt, xml, whatever you want.
jsp tags are supposed to output content where they are. If you need to
autogenerate the head section while you are already in the middle of
your .jsp, then you will need your taglib to act hand in hands with a
requestfilter which will cache response and inject the head at the end.



David Duke a écrit :

 Is this the unique method to do this ?

 I expected to use a JspWriter like to get a writer to the web page
 header !

 Thank you,

 David

 Leon Rosenberg a écrit :

 headyourtag/head?

 regards
 leon

 On 2/23/06, David Duke [EMAIL PROTECTED] wrote:
  

 Hi everybody,

 This is my first post on this mailing list.

 I developped a personal tag librairy which need to inject code - link a
 javascript or stylesheet file - between the XHtml head /head tags
 of  my generated page. The JspWriter object don't seem to suite me.

 Is someone know how to do that ?

 Thanks all,

 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]



   



 -
 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: How to inject code between HEAD /HEAD of a generated page ?

2006-02-23 Thread David Delbecq
Na, he just asummed the tag was doing additionnal work at a later part:


/html
/yourtag

Dave Newton a écrit :

Leon Rosenberg wrote:
  

headyourtag/head?
  


Ah, see, that won't work.

Try

headyourtag//head instead.

;)

(Hey, it was either this or I would have had to respond to the I want
to write a fully object-based Java program, how do I do that? thread ;)

Dave



-
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: How to inject code between HEAD /HEAD of a generated page ?

2006-02-23 Thread David Delbecq
Am pretty sure, JSP is not about xml at all :)

img src=c:url value='blabla'//

and will never fit in a xml parser!


Chris Loschen a écrit :

But you can't do that -- it's not well-formed XML.

Chris 

-Original Message-
From: David Delbecq [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 23, 2006 7:53 AM
To: Struts Users Mailing List
Subject: Re: How to inject code between HEAD /HEAD of a generated page ?

Na, he just asummed the tag was doing additionnal work at a later part:


/html
/yourtag

Dave Newton a écrit :

  

Leon Rosenberg wrote:
 



headyourtag/head?
 
   

  

Ah, see, that won't work.

Try

headyourtag//head instead.

;)

(Hey, it was either this or I would have had to respond to the I want 
to write a fully object-based Java program, how do I do that? thread 
;)

Dave



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





___
Siebel
IT'S ALL ABOUT THE CUSTOMER
Visit www.siebel.com

This e-mail message is for the sole use of the intended recipient(s) and 
contains confidential and/or privileged information belonging to Siebel 
Systems, Inc. or its customers or partners. Any unauthorized review, use, 
copying, disclosure or distribution of this message is strictly prohibited. If 
you are not an intended recipient of this message, please contact the sender 
by reply e-mail and destroy all soft and hard copies of the message and any 
attachments. Thank you for your cooperation.


-
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: How to inject code between HEAD /HEAD of a generated page ?

2006-02-23 Thread David Delbecq
This all depends on what the tag does with it's body ;)

btw if i see headtag/head/tag in a jsp i kill it's author,
whatever the tag is
Leon Rosenberg a écrit :

Am pretty sure, JSP is not about xml at all :)

img src=c:url value='blabla'//

and will never fit in a xml parser!



no, but jsp can produce well formed xhtml (actually its an optional
setting, isn't it?)


so headbla/head/bla is invalid,
but the output of your example:
img src=/blabla// is a valid xhtml.

It's not about the jsp itself, but the output :-)

regards
Leon

On 2/23/06, David Delbecq [EMAIL PROTECTED] wrote:
  

Chris Loschen a écrit :



But you can't do that -- it's not well-formed XML.

Chris

-Original Message-
From: David Delbecq [mailto:[EMAIL PROTECTED]
Sent: Thursday, February 23, 2006 7:53 AM
To: Struts Users Mailing List
Subject: Re: How to inject code between HEAD /HEAD of a generated page ?

Na, he just asummed the tag was doing additionnal work at a later part:


/html
/yourtag

Dave Newton a écrit :



  

Leon Rosenberg wrote:






headyourtag/head?





  

Ah, see, that won't work.

Try

headyourtag//head instead.

;)

(Hey, it was either this or I would have had to respond to the I want
to write a fully object-based Java program, how do I do that? thread
;)

Dave



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





___
Siebel
IT'S ALL ABOUT THE CUSTOMER
Visit www.siebel.com

This e-mail message is for the sole use of the intended recipient(s) and 
contains confidential and/or privileged information belonging to Siebel 
Systems, Inc. or its customers or partners. Any unauthorized review, use, 
copying, disclosure or distribution of this message is strictly prohibited. 
If you are not an intended recipient of this message, please contact the 
sender by reply e-mail and destroy all soft and hard copies of the message 
and any attachments. Thank you for your cooperation.


-
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: [Friday]

2006-02-20 Thread David Delbecq
Marco Mistroni a écrit :

Hello,
 
  

The expression applies in greek as well and is used to point out a 
difficult situation where rope and soap is the obvious way out :-)



Sorry  for being so 'numb'... but I still don' tsee the connection between
A rope and the soap..
You can mail me privately ... I think we are off-topic big time...

Rgds
   marco


  

I think it's to clean the rope, so you don't get infected by any disease
when you get hung. It's like sterilizing material before doing the
lethal injection. :)

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



Re: unsubscribe me

2006-02-16 Thread David Delbecq
Ankit Pancholi a écrit :

hi
please unsubscribe me.
Thanks
Ankit

  


Look! It's magically written here :)

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

  

And here!

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



Re: getRequestUrl returns different url in tomcat 5.0 and tomcat 5.5

2006-02-15 Thread David Delbecq
Please don't reply to other people's messages to ask your questions,
this somehow mixes Threads and people knowing the answer to your
question might not be listening to this current thread.

It's better to create a new message with an appropriate subject line :)

regards.
Srinivas a écrit :

 Hi,

 I am developing a web application in struts1.1, jsp1.2 , servlets2.2.
 This application I need to deploy in iPlanet web server. Can any one
 suggest which version of iPlanet is suitable to develop this
 application.. I have iPlanet web server 6.1 Sp1. But  when I deploy a
 sample application in this it won't recognizes the web application...
 Any suggestions how to deploy and run this application if this is
 suitable.. Please  help in this regard.

 Thank you
 Srinivas Vakkalanka

 - Original Message - From: [EMAIL PROTECTED]
 To: user@struts.apache.org
 Sent: Wednesday, February 15, 2006 6:38 PM
 Subject: getRequestUrl returns different url in tomcat 5.0 and tomcat 5.5


 Hi people,

 I deployed my struts/tiles app in a tomcat 5.0 and it is working
 fine, but
 when I deployed it on a tomcat 5.5.9 it is having a bad comportament.

 I concluded that the error is in the method request.getRequestUrl() that
 returns the abc.do in tomcat 5.0 and returns
 /WEB-INF/pages/mypage.jsp
 in tomcat 5.5.9.

 Does anyone have some solution for my problem? I saw in Tomcat forumns
 that this problem is because, according the servlet specs. tomcat 5.5 is
 right and tomcat 5.0 is wrong, but they say there that this could make
 some struts-tiles apps (or other frameworks also) to work incorrectly.

 Thank´s,

 Roberto C. Lima Jr.
 SoftSite Mobile



 -
 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: filters in web application

2006-02-13 Thread David Delbecq
This all depends on what your filters do.
If each filter is creating wrappers, analysing output stream and so on,
you could indeed get performances issues.
Consider each filter is about 3~4 additional stack level.
Also each filter = 1 object + it's configuration datas
Basically a filter is do
somethingcallnextfilterdosomethingelsereturn
if your do sometings are trivials, there shouldn't be much performances
hits, except for the fact you call lots of methode to get the job done :)


Why do you need so much filters?


temp temp a écrit :

In a web application can I use several filters like 20 to 30 filters  each of 
them serving some functionallity usefull for  more than  one '.do' .Is this a 
good design  or  there  could be  any performance issues when using several 
filters  in a web  application.
  Thanks  regards
  
  
  
   
-
Relax. Yahoo! Mail virus scanning helps detect nasty viruses!
  



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



Re: [test] ignore

2006-02-10 Thread David Delbecq
I see nothing but 7bit charset in you mail, sorry :)
Pilgrim, Peter a écrit :

Testing using Micro$oft Outlock 200 sp3

I seem to be have problems with my mail sent to google group sent as 7bit  
character set. Just want to prove that apache and sourceforge dont
have to the problem, and eliminate these providers.

--
Peter Pilgrim :: J2EE Software Development
Operations/IT - Credit Suisse Group - One Bank,
Floor 15, 5 Canada Square, London E14 4QJ, United Kingdom
Tel: +44-(0)207-883-4497
 peter dot pilgrim at credit-suisse.com 


==
Please access the attached hyperlink for an important electronic 
communications disclaimer: 

http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
==


-
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: URL Submission To Search Engines With Struts

2006-02-02 Thread David Delbecq
I would suggest the welcome.do
Also, take a look at http://www.google.com/webmasters/2.html
Jim Reynolds a écrit :

Hello,

I have been having trouble getting the Search Engines to index my site
properly. My old site was just JSP model 1, and I would just submit
the index.html page.

Since I recrated the site with struts, I now immediately go from that
index.html page to a forward to welcome.do which then does some
business logic, and eventually forwards to a jsp page with dynamic
navs, etc.

Does anyone know which page I need to submit when I am doing this type
of immediate forwarding?

Any help would be appreciated, or insights.

Regards

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



Is struts handling informations differently between post and get?

2006-01-30 Thread David Delbecq
Hello dear members,

We created a seach form using struts. The form uses ISO-8859-1 encoding.
When posting a query with accentuaed characters, no problems.
The browser posts this:
scope=%2FfilesrequestedNodeResults=15uri=xsl=query=pr%E9cipitationsx=0y=0

notice the %E9 in parameters, which corresponds to 'é' character in iso-8859-1
Struts handles it without problem, showing the query parameter on screen also 
works perfectly.

However, if i take this query and issues
search.do?scope=%2FfilesrequestedNodeResults=15uri=xsl=query=pr%E9cipitationsx=0y=0

It all goes wrong, struts decode the %E9 as an interrogation point!
In both cases (POST and GET) the browser does not send a content-encoding to 
server (so server has to guess what content encoding is used)
Also, post is not a multipart

So questions are
1) is it expected behaviour that struts behave differently on POST and GET 
methods regarding the encoding?
2) how to fix it? (i tried switching to utf-8 for query, it got even worse as 
post also don't work anymore then)


-- 
David Delbecq
Royal Meteorological Institute of Belgium

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



Re: data in session affecting performance ?

2006-01-27 Thread David Delbecq
Hello,

I think i read (probably on tomcat mailing list), that clustering should 
ensure (in specs) that a session is not spread across cluster (once session 
is started, user always speak with same jvm which started the session). 

Size of objects contained inside a session might however be a performance 
issue when there is lots of traffic on server (100k+100k+100k+... can make a 
lot after 30 minutes if you assume idle session lifetime of 30 minutes).

But with performances issues, a simulation is a good idea to know if you might 
get affected or not!

Le Vendredi 27 Janvier 2006 10:00, starki78 a écrit :
 Ciao,
 
 I was it who received the answer, well I didn't find
 this performance gap then the session object contained
 for a short time 1MB but I didn't test it in a distributed environment.
 A session-scoped Acion Form shouldn't harm the performance.
 I cannot immagine.
 
 Nice greetings
 
 
 -- Initial Header ---
 
 From  : Lixin Chu [EMAIL PROTECTED]
 To  : Struts Users Mailing List user@struts.apache.org
 Cc  : 
 Date  : Fri, 27 Jan 2006 08:11:05 +0800
 Subject : data in session affecting performance ?
 
 
 
 
 
 
 
  Hi,
  I saw a thread discussing this but can not find it anymore now. I remember
  someone mentioned that the amount of data put into the session context
  should not exceed 32KB in general otherwise performance might be affected.
  
  I may interpreted it wrongly. so i would like to clarify if it is indeed 
the
  case and does this also means that a session scoped ActionForm is really 
bad
  in terms of performance ?
  
  thanks
  lixin
  
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: [FRIDAY] You might be a Wally if ...

2006-01-20 Thread David Delbecq
... you wander everyday in corridors, asking everyone around if there are any 
meetings today.
Le Vendredi 20 Janvier 2006 16:05, Ted Husted a écrit :
 ... your petname for seminars and user group meetings is naps and snacks.
 
 -Ted.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
Tchize

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



Re: [FRIDAY] How to RTFM

2006-01-06 Thread David Delbecq
I just hope nobody on this list will take it seriously...

Le Vendredi 6 Janvier 2006 13:32, Dave Newton a écrit :
 http://uncyclopedia.org/wiki/RTFM
 
 Dave
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: Same action with multiple submit buttons

2005-12-21 Thread David Delbecq
If you want same action, but different submit buttons, your other possiblity is 
DispatchAction + 
buttons like this:

input type=submit name=dispatch value=add/
input type=submit name=dispatch value=delete/
input type=submit name=dispatch value=commit/

Doesn't use javascript, but can be very cumbersome with internationalization.
Le Mercredi 21 Décembre 2005 10:42, Shiby Maria John a écrit :
 
 But that will require javascript, isnt it??
 
 
 
 |-+--
 | |   Pazhanikanthan Periasamy   |
 | |   [EMAIL PROTECTED]|
 | |   aritor.com|
 | |  |
 | |   12/21/2005 02:53 PM|
 | |   Please respond to Struts  |
 | |   Users Mailing List|
 | |  |
 |-+--
   
 --|
   |   
|
   |   To:   Struts Users Mailing List user@struts.apache.org  
|
   |   cc: 
|
   |   Subject:  Re: Same action with multiple submit buttons  
|
   
 --|
 
 
 
 
 Have a hidden attribute called method.
 
 Assign this param with the method name u need to call in the
 DispatchAction Class based on the Button you have clicked and submit
 the
 form.
 
 Thanks and regards,
 Pazhanikanthan. P
 Project Leader,
 Caritor (India) Pvt. Ltd.,
 Madras - 600 006
 Mob: 9886152717
 Extn: 40123
 
 
 
 Shiby Maria John [EMAIL PROTECTED]
 12/21/2005 03:02 PM
 Please respond to
 Struts Users Mailing List user@struts.apache.org
 
 
 To
 Struts Users Mailing List user@struts.apache.org
 cc
 
 Subject
 Same action with multiple submit buttons
 
 
 
 
 
 
 
 Hi,
 Thnaks for the tip reg LookupDispatchAction, but the problem is that I
 have the same name for different buttons in the same form.
 In that case, how will I know which button submitted that action??
 
 
 
 
 -
 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]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: Any step by step tutorial for internationalization of application

2005-12-20 Thread David Delbecq
Automated tools can help you extract messages from your source code and put 
them in ressource bundles.
eclipse: open java file, source - externalize strings

This is how to internazionalize an eclipse plugin, but basic ideas are same for 
web app
http://www.eclipse.org/articles/Article-Internationalization/how2I18n.html
Except in webapp you never use the default locale, but you use the one stored 
in user session :)
Le Mardi 20 Décembre 2005 16:48, sma3har a écrit :
 We are planning to internationalize our application.
 Any step by step tutorial for internationalization of
 application?
 
 Thanks
 Harita
 
 __
 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]
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

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



Re: [OT] It's FRIDAY!!!

2005-10-28 Thread David Delbecq
Complaining about someone's gender can be a full troll topic
with some people i know :)

Ok, you wanna start a disclaimer hunt?

Some user of the redhat mailing list suggested this one in 2003

https://www.redhat.com/archives/fedora-list/2005-March/msg06354.html

IMPORTANT: This email is intended for the use of the individual
addressee(s) named above and may contain information that is
confidential, privileged or unsuitable for overly sensitive persons with
low self-esteem, no sense of humour or irrational religious beliefs. If
you are not the intended recipient, any dissemination, distribution or
copying of this email is not authorised (either explicitly or
implicitly) and constitutes an irritating social faux pas.
Unless the word absquatulation has been used in its correct context
somewhere other than in this warning, it does not have any legal or no
grammatical use and may be ignored. No animals were harmed in the
transmission of this email, although the kelpie next door is living on
borrowed time, let me tell you. Those of you with an overwhelming fear
of the unknown will be gratified to learn that there is no hidden
message revealed by reading this warning backwards, so just ignore that
Alert Notice from Microsoft.
However, by pouring a complete circle of salt around yourself and your
computer you can ensure that no harm befalls you and your pets. If you
have received this email in error, please add some nutmeg and egg
whites, whisk and place in a warm oven for 40 minutes.




James Mitchell a écrit :

 Sometimes employers require such a disclaimer from all employees, 
 others enforce it on the mail server.  Either way, it is not likely 
 the choice of the people who send them.

 Honestly, I don't really understand why you created this thread.  
 Complaining about this is like complaining about someone's gender.



 -- 
 James Mitchell
 Software Engineer / Open Source Evangelist
 Consulting / Mentoring / Freelance
 EdgeTech, Inc.
 http://www.edgetechservices.net/
 678.910.8017
 AIM:   jmitchtx
 Yahoo: jmitchtx
 MSN:   [EMAIL PROTECTED]
 Skype: callto://jmitchtx





 On Oct 28, 2005, at 8:34 AM, Larry Meadors wrote:

 So, here is an irrelevant topic.

 What is with the 500 word essays for email discalimers on public 
 mailing
 lists?

 This e-mail is confidential and intended for the use of the named 
 recipient
 only.

 WTH?!?


 Larry


 By opening this email, you acknowledge that you are a Friday  slacker
 like
 me.



 -
 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: new website look

2005-10-25 Thread David Delbecq
Michael Jouravlev a écrit :

On 10/24/05, Wendy Smoak [EMAIL PROTECTED] wrote:
  

From: Michael Jouravlev [EMAIL PROTECTED]



Firefox 1.0.6 on W2K -- site is screwed up.
  

So you've mentioned. :)  Except for the left-hand column resizing itself
smaller than the ApacheCon logo, I don't see any major problems.



Yes, this is a problem ;-) Also, there is no background color set, so
pages can look funny with, say, blue. Or green :-)

  

As Frank mentioned, the site is generated by Maven, which means we are not
(and do not want to be) in control of the XSLT and CSS that make it happen.



  

maven allows you to provide your own css for your projet.
http://maven.apache.org/maven-1.x/using/site.html

You chose the tool, it does not work 100% correctly, should you choose
another tool? The issue with logo may seem minor, but your position is
disturbing to say the least.

Digressing, may I ask, why Maven and not Forrest? If you find a minute
to explain in two-three phrases, how these two relate to each other?

Michael.

-
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: Best Practice: How to reinititialize client ?

2005-10-25 Thread David Delbecq
use reset() method of order related session forms.
Silvija Cardzic-Mrsa a écrit :

Hi,

Im new to struts and developing a shop with Struts.
After a customer sent his order it should be possible to make a new order 
( same session ).
Whats the best practice to do this and how ?

Thanks
Silvija


  



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



stupid EL evaluation question

2005-10-20 Thread David Delbecq
Hello, might some of you enlight my path to redemption?

I tried to use this inside a jsp:

c:choose
c:when test=${1==1}
html-el:select
property=actionParameters(${parameter.key}).value
html-el:option value=true/
html-el:option value=false/
/html-el:select
/c:when
c:otherwise
non boolean html-el:text
property=actionParameters(${parameter.key}).value/
/c:otherwise
/c:choose

strange enough, i always end in the otherwise part :/  (note, c:
correspond to jstl/core as
struts don't have a switch case in the logic taglib)

To simplify the debugging i put this inside my jsp:

c:if test=${1==1}1==1 yes/c:if

Test is evaluated as false! Now am sure, am in the twilight zone.
But this success:
c:if test=truetrue is true/c:if


jstl/core test parameter are supposed to accept EL evaluated parameter.
But i can't understand why
mine are failing, considering i have another webapp where things like that:
c:if test=${param.mode=='list'}

works perfectly as requested !!!

Does someone have any idea why jstl/core would fail like that???


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



Re: R: stupid EL evaluation question

2005-10-20 Thread David Delbecq
Hi Amleto,

am using tomcat 5.5.7, jstl 1.1.2

my web.xml declaration is as follow.


taglib
taglib-urihttp://java.sun.com/jsp/jstl/core/taglib-uri
taglib-location/tld/c.tld/taglib-location
/taglib

More over fact it's Interger not int shouldn't matter, as i said,
another webapp
which has

${param.mode=='list'} in it's test is working, that i can suppose == is 
converted in EL expression 
by a equals() call.



Amleto Di Salle a écrit :

Hi,
Which version of JSP+JSTL (and Tomcat) are you using?

I am not sure but I think that the problem is due to fact that 1 is
considered as an Integer class. 
This is possible, i suppose, in two cases:
- you are using JSP1.2+JSTL1.0
- or in the taglib directive you are using
http://java.sun.com/jstl/core; and not
http://java.sun.com/jsp/jstl/core; also in JSP2.0+JSTL1.1.
In  http://java.sun.com/jstl/core; you use the core1.0 and the
expression language (EL) is evaluated by JSTL and not by JSP, so 1 is
considered Integer (in this case in Java new Integer(1)==new Integer(1)
is false).
In the http://java.sun.com/jsp/jstl/core; case the EL is evaluated by
JSP and the 1 is considered int.

I hope this is useful

BR
/Amleto



  

-Messaggio originale-
Da: David Delbecq [mailto:[EMAIL PROTECTED] 
Inviato: giovedì 20 ottobre 2005 12.33
A: Struts Users Mailing List
Oggetto: stupid EL evaluation question


Hello, might some of you enlight my path to redemption?

I tried to use this inside a jsp:

c:choose
c:when test=${1==1}
html-el:select 
property=actionParameters(${parameter.key}).value
html-el:option value=true/
html-el:option value=false/
/html-el:select
/c:when
c:otherwise
non boolean html-el:text 
property=actionParameters(${parameter.key}).value/
/c:otherwise
/c:choose

strange enough, i always end in the otherwise part :/  (note, 
c: correspond to jstl/core as struts don't have a switch case 
in the logic taglib)

To simplify the debugging i put this inside my jsp:

c:if test=${1==1}1==1 yes/c:if

Test is evaluated as false! Now am sure, am in the twilight 
zone. But this success: c:if test=truetrue is true/c:if


jstl/core test parameter are supposed to accept EL evaluated 
parameter. But i can't understand why mine are failing, 
considering i have another webapp where things like that: 
c:if test=${param.mode=='list'}

works perfectly as requested !!!

Does someone have any idea why jstl/core would fail like that???


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

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/143 - Release 
Date: 19/10/2005
 




  



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



Re: R: stupid EL evaluation question

2005-10-20 Thread David Delbecq
Ok, i finally found the problem. The doctype of my web.xml was
!DOCTYPE web-app
PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
http://java.sun.com/dtd/web-app_2_3.dtd;

which disable all EL in tomcat.
Solution was to replace with
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; version=2.4


thanks for help.

Ronald Holshausen a écrit :

I've been looking at the JSP 2.0 spec, and this might be a bug.

BTW, you don't need the taglib declaration in your web.xml, you can
just use the URI in your jsp file and the taglib will be loaded from
the jstl jars.

On 20/10/05, David Delbecq [EMAIL PROTECTED] wrote:
  

Hi Amleto,

am using tomcat 5.5.7, jstl 1.1.2

my web.xml declaration is as follow.


taglib
taglib-urihttp://java.sun.com/jsp/jstl/core/taglib-uri
taglib-location/tld/c.tld/taglib-location
/taglib

More over fact it's Interger not int shouldn't matter, as i said,
another webapp
which has

${param.mode=='list'} in it's test is working, that i can suppose == is 
converted in EL expression
by a equals() call.



Amleto Di Salle a écrit :



Hi,
Which version of JSP+JSTL (and Tomcat) are you using?

I am not sure but I think that the problem is due to fact that 1 is
considered as an Integer class.
This is possible, i suppose, in two cases:
- you are using JSP1.2+JSTL1.0
- or in the taglib directive you are using
http://java.sun.com/jstl/core; and not
http://java.sun.com/jsp/jstl/core; also in JSP2.0+JSTL1.1.
In  http://java.sun.com/jstl/core; you use the core1.0 and the
expression language (EL) is evaluated by JSTL and not by JSP, so 1 is
considered Integer (in this case in Java new Integer(1)==new Integer(1)
is false).
In the http://java.sun.com/jsp/jstl/core; case the EL is evaluated by
JSP and the 1 is considered int.

I hope this is useful

BR
/Amleto





  

-Messaggio originale-
Da: David Delbecq [mailto:[EMAIL PROTECTED]
Inviato: giovedì 20 ottobre 2005 12.33
A: Struts Users Mailing List
Oggetto: stupid EL evaluation question


Hello, might some of you enlight my path to redemption?

I tried to use this inside a jsp:

   c:choose
   c:when test=${1==1}
   html-el:select
property=actionParameters(${parameter.key}).value
   html-el:option value=true/
   html-el:option value=false/
   /html-el:select
   /c:when
   c:otherwise
   non boolean html-el:text
property=actionParameters(${parameter.key}).value/
   /c:otherwise
   /c:choose

strange enough, i always end in the otherwise part :/  (note,
c: correspond to jstl/core as struts don't have a switch case
in the logic taglib)

To simplify the debugging i put this inside my jsp:

c:if test=${1==1}1==1 yes/c:if

Test is evaluated as false! Now am sure, am in the twilight
zone. But this success: c:if test=truetrue is true/c:if


jstl/core test parameter are supposed to accept EL evaluated
parameter. But i can't understand why mine are failing,
considering i have another webapp where things like that:
c:if test=${param.mode=='list'}

works perfectly as requested !!!

Does someone have any idea why jstl/core would fail like that???


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

--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.12.4/143 - Release
Date: 19/10/2005







  

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



Need to contact mailing list admin regarding delivery issues

2005-09-26 Thread David Delbecq
Hello,

I need to contact the admin of this mailing list regarding issues with it.
Please cc: your reply to david.delbecq at myrealbox.com to ensure delivery.


Thanks.



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



Custom data-type classes, howto

2005-09-21 Thread David Delbecq
Hello,

I'm seeking for help/documentation pointers on how to
manage custom data-types in struts.
Am wanting to know if it's possible to manage complex data-type
(that is data-types which need more than one field to be displayed / filled)
All this considering my form contains an array named parameters[]
with each parameter being either a File, an int, a String, a complex type.

Thanks a lot.


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



Re: How to validate in Struts 1.2.7

2005-09-21 Thread David Delbecq
This will help you :)
don't forget to add validate=true in your struts-config.xml


public class MyForm extends ActionForm {
   
public static int MAX =100;
private Integer value;
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest args) {
ActionErrors errors = new ActionErrors();
if (getValue().intValue()0)
errors.add(value,new ActionMessage(value.MustBePositive));
if (getValue().intValue()=MAX)
errors.add(value,new ActionMessage(value.MustBeBelowMax));
return errors;
}
}
Francisco Antonio Vieira Souza a écrit :

 Considering that nobody saw my big previous message about this subject.
 I ask you all, does anyone could provide me any example of validation
 in Struts 1.2.7? (since until now I had no success)

 

 

 ___ Novo Yahoo!
 Messenger com voz: ligações, Yahoo! Avatars, novos emoticons e muito
 mais. Instale agora! www.yahoo.com.br/messenger/

 -
 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: passing JavaBeans through an ActionForm?

2005-09-21 Thread David Delbecq
Koen Jans a écrit :

Here's my problem;

A user has several accounts, represented by AccountBean objects, all
having a unique accountId. 

Now, i have a form where the user can select one of his accounts to edit
through a radio button selection. For the associated ActionForm, i see
two options to represent the selected account;

1) on my ActionForm;  a property int selectedAccountId
2) on my ActionForm;  a property AccountBean selectedAccount 

The first option seems good because it preserves the philosophy that an
ActionForm represents the user's input..

The second is nice because the edit-Action, associated with the form,
can immediately extract the selectedAccount from the ActionForm, whereas
using the first approach, a database call is needed to retrieve the
selected account again by the account's id.

Which option would you prefer, and especially why? Thanks for your time



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

  

The second option may have some problems imho. Every setter in AccountBean
is potentially accessible from the user's point of view using
http://host/webapp/accountAction.do?XXX=12345 where there is a setXXX() on
bean. If your bean is just there to represent some informations (that is
every call
to setXXX is legitimate for user having rights to the .do action)
there is no problem with it. But if your bean is, for example, to be
persisted as is in a database,
this might be dangerous. What happen if a clerk presented an
editAccountPersonalInformations
from does use this immediate access to call via struts setAccountCredit() ?

Now, i have used your second option quite often, on places where i
didn't mind
access rights.

Now a good way to prevent illegal access to methods is to use the
AccountBean private inside form
and provide public delegate call to legitimate methods :)

regards


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



Re: Custom data-type classes, howto

2005-09-21 Thread David Delbecq
Sorry I was not clear.
Am not asking how to display it in the JSP. This part is quite
straightforward.
What am wondering is how does struts manage the submission of form by user.
If I take the simple example where parameter[0] is to be holder a String and
parameter[1] to be the holder of a Person.
I assume generate this kind of form as result of jsp
form (details on submission here)
input type=hidden name=parameter[0].type value=java.lang.String/
input type=text name=parameter[0].value value=default content 0/
input type=hidden name=parameter[1].type
value=com.mycompany.beans.Person/
input type=text name=parameter[1].value.firstname value=default
firstname/
input type=text name=parameter[1].value.lastname value=default
lastname/
/form

I was thinking to have a form with an array of VariableParameter.
VariableParameter is a custome bean which have 2 properties.
One String for type and one 'Object' for the value.
Perhaps having value as a DynaBean which is then converted to
real type when type is known.
I know there are converter thingies in beanutils used by struts.
Am just wondering if there is an easy way to manage the final convertion
(probably during the validate step if struts is unable to handle it by
itself)
from a DynaBean to SomeCustomClass

thanks
Murray Collingwood a écrit :

On reading this I initially thought you had an array of objects where each 
object was a 
group of objects such as a file, an int, a string etc.  Then I wondered 
whether your array 
of objects was just that, the first object a file, the second object an int, 
the third object a 
string etc.  Obviously this is more complicated.  It sounds as though you are 
asking if 
Struts has some sort of reflectionyes!

It's called custom tag libraries.

Pass the object to a custom tag library and deal with it appropriately.

When you pass the object it will be just that, an object, unless you also pass 
the type, 
for example:
Object object;
String objectType;
mylib:display obj=${attributeName.property1}  
objType=${attributeName.property2}/

Kind regards
mc


On 21 Sep 2005 at 10:32, David Delbecq wrote:

  

Hello,

I'm seeking for help/documentation pointers on how to
manage custom data-types in struts.
Am wanting to know if it's possible to manage complex data-type
(that is data-types which need more than one field to be displayed / filled)
All this considering my form contains an array named parameters[]
with each parameter being either a File, an int, a String, a complex type.

Thanks a lot.


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



-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.3/107 - Release Date: 20/09/2005






FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



  



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



Re: [Hibernate] This stuff is cool

2005-09-20 Thread David Delbecq
First, Hibernate Mailing List might be a better list to answer your questions.
However, i'll try to answer as am also an Hibernate user.
Le Mardi 20 Septembre 2005 06:30, Murray Collingwood a écrit :
 Hi all
 
 Hibernate is an excellent tool!  I managed to get it running quite quickly, 
 only a few 
 small issues to resolve, fortunately the error messages were fairly clear.
 
 I've implemented Hibernate into the beginning of a new Struts app, however my 
 code 
 isn't looking like the examples and I'm wondering if I'm putting files in the 
 wrong places.  
 Here is the structure I have:
 
 Note, the term Menu here refers to a restaurant menu item.
 
 Form bean MenuForm is stored in com.path.controller.form
 Action class is in com.path.controller.action
 
 In this app my form beans reflect closely the database so I am using the same 
 form 
 bean classes for the model.

You mean you are persisting the Struts forms in database?
This is dangerous i think. I'll recommend using the delegate design
pattern to prevent user access to some setters of the bean
(eg. Hibernate requires you to have a setOwner on a bean to
populate it from database but you don't want somebody to be
allowed to change the owner by doing someAction.do?owner=SomeFakeOwner)
So better have form do this:
getXXX(){
return theBean.getXXX();
}
and persist theBean :)
This way you have better control on form setters

 
 I created Menu.hbm.xml and tried placing it in com.path.controller.form as 
 the 
 Hibernate documentation said to place these 'hbm' files with the pojos.  When 
 I tried to 
 start the app Hibernate complained that it couldn't find the Menu.hbm.xml 
 file.  So I 
 moved the file around a bit, finally placing it in the root of the Source 
 directory, eg 
 src/Menu.hbm.xml with src/com/path/controller/form/MenuForm.java.  The 
 contents 
 of my Menu.hbm.xml is as follows:
 
 ?xml version=1.0?
 !DOCTYPE hibernate-mapping PUBLIC
 -//Hibernate/Hibernate Mapping DTD 3.0//EN
 http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd;
 
 hibernate-mapping
 
 class name=com.path.controller.form.MenuForm table=Menu
 id name=mid
 generator class=native/
 /id
 property name=title/
 property name=description/
 property name=price type=float/
 property name=rating type=int/
 property name=dateFrom type=date/
 property name=dateTo type=date/
 property name=imageid type=int/
 /class
 
 /hibernate-mapping
 
 
 My hibernate.cfg.xml is:
 
 ?xml version=1.0 encoding=UTF-8?
 !DOCTYPE hibernate-configuration PUBLIC
 -//Hibernate/Hibernate Configuration DTD//EN
 http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd;
 
 hibernate-configuration
 session-factory
 property 
 name=connection.datasourcejava:comp/env/jdbc/dbname/property
 property name=show_sqltrue/property
 property name=dialectorg.hibernate.dialect.MySQLDialect/property
 
 !-- Drop and re-create the database schema on startup --
 property name=hbm2ddl.autocreate/property
 
 !-- Mapping files --
 mapping resource=Menu.hbm.xml/
 
 /session-factory
 /hibernate-configuration
 
 
 THE QUESTION IS: My hbm file is not stored next to the pojo and has to 
 reference it 
 using the full path.  Is this normal?  Is there a better way of doing this?  
 
As Hibernate documentation says, put it along the POJO. If Hibernate didn't 
find it, it's perhaps 
because of your compilation process. Some ide/automated tools like maven only 
compile classes 
in src/ directory to target/ directory, they do not copy ressources. Try to 
create a separate ressources
directory which is copied in target directory as part of compilation process.


For info, here we put our .hbm files in 
webapp/WEB-INF/classes/com/company/somePath
because in compilation process, webapp/* is copied in final war :)


With all this, we have our own session factory which is a singleton having this 
in constructor:

Configuration configuration = new Configuration();

// ensure that the *.hbm.xml is located in bin/be/rmi/intranet/db
// (where the class is)
for (int i = 0; i  persistedClasses.length; i++) {
configuration.addClass(persistedClasses[i]);
}
sessionFactory = configuration.configure().buildSessionFactory();


with 
private static Class[] persistedClasses = new Class[] { V4_news.class,
Scpub.class, User.class, Function.class, FunctionBackup.class,
Vacancy.class, TimeKeeper.class, Project.class };
 Kind regards
 mc
 
 
 
 FOCUS Computing
 Mob: 0415 24 26 24
 [EMAIL PROTECTED]
 http://www.focus-computing.com.au
 
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Pingouins dans les champs, hiver méchant

-
To unsubscribe, e-mail: [EMAIL

Re: Being Lazy with Hibernate

2005-09-20 Thread David Delbecq
For lazy initialization to work, at the moment of the lazy initialisation,
(that is the moment you request the data) the hibernate session must
not be closed.
The best way to do this is to store the hibernate session in the user
session and use a servlet filter to connect/disconnect/reconnect the
hibernate
session.

Martin Ravell a écrit :

Has anyone been able to get a Struts / Hibernate app to work nicely with
Lazy Initialization?

Whenever I have things with Lazy set to true I'm getting a Failed to lazily
initialize a collection Exception.

I'd like to be able to lazily access related objects in my DAO layer,
potentially my Actions and the JSPs of the frontend as well. (I use tiles as
well if that affects things).

Is this possible? I've posted once or twice to the Equinox list but it seems
a little low on traffic these days and was wondering if anyone else out
there has done this particular thing with the same combination of
technologies?

If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a
Tomcat 4 plugin (not my choice and I cannot change it), an Apache web server
and Oracle as the DB.

If there is anyone out there being successfully lazy I'd love to hear from
you. I've been trying filters and such things but without result so far.



Regards
Marty






-
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: Being Lazy with Hibernate

2005-09-20 Thread David Delbecq
See sections
20.1.4. Initializing collections and proxies and 1.4, “Playing with cats”
For details :) (Hibernate 3 documentation)
Martin Ravell a écrit :

Hi David,

This sounds good but I should have mentioned that I am somewhat new to this
particular area and as a result I have no idea how to go about doing what
you have suggested.

I will continue to research but would you be able to help me with a little
more detail on what this entails?


Regards
Marty

-Original Message-
From: David Delbecq [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 20 September 2005 10:04 PM
To: Struts Users Mailing List
Subject: Re: Being Lazy with Hibernate

For lazy initialization to work, at the moment of the lazy initialisation,
(that is the moment you request the data) the hibernate session must
not be closed.
The best way to do this is to store the hibernate session in the user
session and use a servlet filter to connect/disconnect/reconnect the
hibernate
session.

Martin Ravell a écrit :

  

Has anyone been able to get a Struts / Hibernate app to work nicely with
Lazy Initialization?

Whenever I have things with Lazy set to true I'm getting a Failed to


lazily
  

initialize a collection Exception.

I'd like to be able to lazily access related objects in my DAO layer,
potentially my Actions and the JSPs of the frontend as well. (I use tiles


as
  

well if that affects things).

Is this possible? I've posted once or twice to the Equinox list but it


seems
  

a little low on traffic these days and was wondering if anyone else out
there has done this particular thing with the same combination of
technologies?

If it is at all relevant my app is using Hibernate 2, JBoss 3.2.1 with a
Tomcat 4 plugin (not my choice and I cannot change it), an Apache web


server
  

and Oracle as the DB.

If there is anyone out there being successfully lazy I'd love to hear from
you. I've been trying filters and such things but without result so far.



Regards
Marty






-
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: Could struts be corrupting my byte[]?

2005-09-13 Thread David Delbecq
Le Lundi 12 Septembre 2005 16:36, Letícia Álvares Barbalho a écrit :
 I did what you suggested and changed from byte[] to String, leaving to 
 conversion to hibernate's level. It did solve the problem, thank you.
 
 But I'm wondering here... I still got a problem with the charset, don't I?
 

Well if String is correct in form, you don't have charset problems in the struts
part (decoded ok from browser's POST to ActionForm). However, am not sure
struts handle automatic conversion from String to byte[]. When your action 
forms is filled, 
here is what happens in non-fileupload forms:
- Browser send form field in a specific encoding.
- Servlet container or commons-fileupload decodes submitted datas and convert 
them to string parameters
- Struts take all submited parameters and uses the beanutils populate() method 
to fill ActionForm
- For each parameter, populate tries to convert the String to the appropriate 
Setter parameter using converters
- In the case of a setXXX(byte[]) signature, the ByteArrayConverter is used.

As far as i can see in this converter source, it's purpose is to convert a 
string like 58,107,24,89 into byte[] {58,107,24,89}
which is not what you want i think.

Why i suggested you to explicitly specify the charset used in String to byte[] 
is because you are storing text in blob on your database, 
that means you must have decided when designed the database, which charset you 
wanted to use (i assumed utf-8). 
You must remain consistent in your various byte[]-String conversion to this 
blob field.
I suggested UTF-8, but maybe some other thing might be more suitable for you.

Anyway, once you have decided a charset for your blob, stick with it.

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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



Re: Could struts be corrupting my byte[]?

2005-09-12 Thread David Delbecq
As far as i read, you are using an html:text field along a form property of 
type byte[]
eg: you type Hello World an you want your form to store 
byte[] b={72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100}

If that's the case, i think declaring the field descricao as a byte in your 
struts form
is not a good idea. Your should declare it as a String and convert it to byte[]
when you reach the hibernate level. To keep with your example, this mean
a prototype in your form like this:
public String getDescricao();
public void setDescricao(String);

Then you can transfer to cor like this
cor.setDescricao(addCorForm.getDescricao().getBytes(UTF-8));

and you can get back from cor like this:
String s = new String(cor.getDescricao(),UTF-8);

why? Because if you do not specify the character encoding when
you are converting between bytes and String, you use the platform
dependent character encoding, which may leads you in problems if this
platform dependent encoding change (eg. moving you webserver from 
windows to unix)

Also someone suggested you check the character encoding of client http request,
as an additional comment on that suggestion, i'll suggest you try to use the 
accept-encoding parameter of the form tag.

Hope this helps

Le Lundi 12 Septembre 2005 14:35, Letícia Álvares Barbalho a écrit :
 Hello, everyone.
 
 I have an app which uses struts + hibernate. I was having a problem of 
 corrupted blobs (which are treated by the app as byte[]), and so far I was 
 blaming hibernate for that. But right now, making a test, I found out that 
 my data gets corrupted BEFORE even being treated by hibernate. Here's what I 
 have:
 
 1. A jsp page that gets a String using html:text, property = descricao
 2. An action form that has the descricao property as a byte[], together with 
 its getters and setters
 3. An action that takes data from this action form and puts it in my object, 
 which by the way also has this property as a byte[], with its getters and 
 setters.
 
 So, what I wanna do is get this String and put in a blob field. Here comes 
 my action code:
 
 cor.setCor(addCorForm.getCor());
 cor.setNome(addCorForm.getNome());
 cor.setDescricao(addCorForm.getDescricao());
 CorService.getInstance().addCor(cor);
 
 That's basically it: I set the properties and add. The thing is that if I 
 get the byte[] value of addCorForm.getDescricao() and convert it to a 
 string, it gives me NULL or a lot of weird characters. That means my data is 
 getting corrupted right there, before its insertion.
 
 Another proof of it, is that if I insert a line in this table using the 
 database's tool, I can retrieve the information through my application.
 
 So... database tool = correct data. App = incorrect data, even before adding 
 the object in the DB with hibernate. What I can think here is struts is 
 corrupting... could it be?
 
 1. Is html:text the correct component I have to use for this?
 2. Do I have to make any conversion, being that I insert a String and it 
 gets a byte[]?
 
 How do you guys do it? Thank you all very much for the help
 
 
 
 
 
 

-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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



Re: File Upload enctype

2005-08-26 Thread David Delbecq
Le Vendredi 26 Août 2005 08:23, Anuradha S.Athreya a écrit :
 Hello,
 
 I have 2 different issues, which are listed below 
 (1)   To upload a file , is it necessary to specify the
 enctype=multipart/form-data. Can Struts handle file upload in another way
 when the enctype has not been specified.

not that i know about (struts uses jakarta http fileupload library, supporting 
only multipart/form-date for files)
and am not sure another method has been defined by w3c.

 (2)
   script
 function validateDelete()
 {
   return confirm(Delete Data);  
 }
 /script 
 
 
   html:link action=deleteData name=deleteDataParams scope=page
 onclick=return validateDelete() 
   Delete Data 
   /html:link
 
   To the validateDelete() Javascript function, I want to pass a java
 variable. How do I do it? 
   Once I pass the variable, my javascript function has to be :
 
   script
 function validateDelete(data)
 {
   return confirm(Delete Data+data); 
 }
 /script 
 

Have you tried this?
html:link action=deleteData name=deleteDataParams scope=page 
onclick=return validateDelete('${someBean.someValue}') 
Delete Data 
/html:link
-- 
David Delbecq
Royal Meteorological Institute of Belgium

-
Is there life after /sbin/halt -p?

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