Skip parsing of property for json plugin

2014-05-31 Thread Dimitris Mouchritsas

Hi all,

I'm using struts2-core 2.3.16.3 along with struts2-json-plugin and I 
have the following problem:


I have an entity bean, say Event which has the following 3 properties:
id, dateCreated and data

data is already a json string saved in the database.
e.g.:
Event data: 
{id:1003,username:admin3,email:t...@example.com,lastname:Lastname,f_user_type:1,firstname:Firstname,password:fdhfdfh}


Now in my struts2 action I have a ListEvent gridModel which I feed to 
a jquery grid.


My problem is that the data property string is being escaped, e.g:

{JSON:success,actionErrors:[],actionMessages:[],someId:3,destination:null,errorMessages:[],errors:{},fieldErrors:{},gridModel:[{data:{\id\:1,\username\:\admin\,\email\:\ad...@example.com\,\lastname\:\Lastname\,\f_user_type\:1,\firstname\:\Firstname\,\password\:\***\},dateCreated:2014-05-30T18:15:10,id:46009},{data:{\id\:1002,\username\:\admin2\,\email\:\t...@example.com\,\lastname\:\Lastname\,\f_user_type\:1,\firstname\:\Firstname\,\password\:\\},dateCreated:2014-05-30T18:15:10,id:46010},{data:{\id\:1004,\username\:\admin4\,\email\:\t...@example.com\,\lastname\:\Lastname\,\f_user_type\:1,\


Is there any way to avoid this escaping? What alternatives do I have?
One idea is to just return a tiles plugin and create the json string by 
hand in a jsp.


From what I've seen @JSON annotation does not have the option to skip 
escaping. This might be nice.


Regards
Dimitris

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with validation

2009-08-19 Thread Dimitris Mouchritsas

Hi all,
in my project we're using Struts 1.3.8. I have a case of editing an 
organisation. Because we have two types of organisations, I'm using a 
BaseOrganisationForm (extends ValidatorForm) as a form bean where I've 
put the validation as xdoclet tags. Then I inherit this class from 
OrganisationForm.


OrganisationForm has the fields for both types of organisations and 
depending on the organisation type I do custom validation of the fields 
in the validate method.


In the action classes I have a PrepareEditOrganisationAction and 
EditOrganisationAction with the later doing the real work of course. In 
the Prepare action I set some request attributes so I can enable or 
disable some form elements in the GUI. Thus I've also set the xdoclet 
tag for my edit action as follows:


 * @struts.action name=organisationForm path=/editOrganisation
 *validate=true input=/prepareEditOrganisation.do
 *cancellable=true

So that upon an error, I first go to the prepare action again and set 
the request attributes. However the problem is that if I put an invalid 
organisation name which is declared in BaseOrganisationForm everything 
seems to work ok. The form fields that should remain enabled are enabled 
(from the request attributes). If I put an invalid field at one of the 
OrganisationForm fields it seems to go to the prepare action but calls 
the input of that, without really setting the request attributes, thus 
the fields are shown disabled.


Any ideas how I can fix this? Sorry for the long post.
Regards
Dimitris

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with validation

2009-08-19 Thread Dimitris Mouchritsas

Hi all,
in my project we're using Struts 1.3.8. I have a case of editing an
organisation. Because we have two types of organisations, I'm using a
BaseOrganisationForm (extends ValidatorForm) as a form bean where I've
put the validation as xdoclet tags. Then I inherit this class from
OrganisationForm.

OrganisationForm has the fields for both types of organisations and
depending on the organisation type I do custom validation of the fields
in the validate method.

In the action classes I have a PrepareEditOrganisationAction and
EditOrganisationAction with the later doing the real work of course. In
the Prepare action I set some request attributes so I can enable or
disable some form elements in the GUI. Thus I've also set the xdoclet
tag for my edit action as follows:

 * @struts.action name=organisationForm path=/editOrganisation
 *validate=true input=/prepareEditOrganisation.do
 *cancellable=true

So that upon an error, I first go to the prepare action again and set
the request attributes. However the problem is that if I put an invalid
organisation name which is declared in BaseOrganisationForm everything
seems to work ok. The form fields that should remain enabled are enabled
(from the request attributes). If I put an invalid field at one of the
OrganisationForm fields it seems to go to the prepare action but calls
the input of that, without really setting the request attributes, thus
the fields are shown disabled.

Any ideas how I can fix this? Sorry for the long post.
Regards
Dimitris


-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Problem with validation

2009-08-19 Thread Dimitris Mouchritsas

Hi all,
in my project we're using Struts 1.3.8. I have a case of editing an
organisation. Because we have two types of organisations, I'm using a
BaseOrganisationForm (extends ValidatorForm) as a form bean where I've
put the validation as xdoclet tags. Then I inherit this class from
OrganisationForm.

OrganisationForm has the fields for both types of organisations and
depending on the organisation type I do custom validation of the fields
in the validate method.

In the action classes I have a PrepareEditOrganisationAction and
EditOrganisationAction with the later doing the real work of course. In
the Prepare action I set some request attributes so I can enable or
disable some form elements in the GUI. Thus I've also set the xdoclet
tag for my edit action as follows:

 * @struts.action name=organisationForm path=/editOrganisation
 *validate=true input=/prepareEditOrganisation.do
 *cancellable=true

So that upon an error, I first go to the prepare action again and set
the request attributes. However the problem is that if I put an invalid
organisation name which is declared in BaseOrganisationForm everything
seems to work ok. The form fields that should remain enabled are enabled
(from the request attributes). If I put an invalid field at one of the
OrganisationForm fields it seems to go to the prepare action but calls
the input of that, without really setting the request attributes, thus
the fields are shown disabled.

Any ideas how I can fix this? Sorry for the long post.
Regards
Dimitris



-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



Different error messages for client and server side validation

2008-09-30 Thread Dimitris Mouchritsas

Hi all,
we are using a elements in our error messages to allow the user to go 
to the form field when the error message shows up.
Obviously this messes up the client side javascript popup message which 
shows like: a href=#UsernameUsername/a is missing.
Is there a way to use a different error message or should we abandon the 
idea of client side validation?


Regards
Dimitris Mouchritsas

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



Re: Different error messages for client and server side validation

2008-09-30 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Hi all,
we are using a elements in our error messages to allow the user to 
go to the form field when the error message shows up.
Obviously this messes up the client side javascript popup message 
which shows like: a href=#UsernameUsername/a is missing.
Is there a way to use a different error message or should we abandon 
the idea of client side validation?


Regards
Dimitris Mouchritsas

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


BTW Struts v1.3.8

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



Re: Different error messages for client and server side validation

2008-09-30 Thread Dimitris Mouchritsas

Kawczynski, David wrote:

Your Action classes can add ActionMessages for a specific property, not
just GLOBAL_MESSAGES.  
Then, display GLOBAL_MESSAGES at the top of the page, and field-specific

ones relative to the field.
(this will work in 1.3.8)

See
http://struts.apache.org/1.2.7/api/org/apache/struts/action/ActionMessag
es.html 


Specifically:
add(java.lang.String, org.apache.struts.action.ActionMessage)
get(java.lang.String)

-Original Message-
From: Dimitris Mouchritsas [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 30, 2008 11:23 AM

To: Struts Users Mailing List
Subject: Re: Different error messages for client and server side
validation

Dimitris Mouchritsas wrote:
  

Hi all,
we are using a elements in our error messages to allow the user to 
go to the form field when the error message shows up.
Obviously this messes up the client side javascript popup message 
which shows like: a href=#UsernameUsername/a is missing.
Is there a way to use a different error message or should we abandon 
the idea of client side validation?


Regards
Dimitris Mouchritsas

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



BTW Struts v1.3.8

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

Notice:  This e-mail message, together with any attachments, contains
information of Merck  Co., Inc. (One Merck Drive, Whitehouse Station,
New Jersey, USA 08889), and/or its affiliates (which may be known
outside the United States as Merck Frosst, Merck Sharp  Dohme or
MSD and in Japan, as Banyu - direct contact information for affiliates is
available at http://www.merck.com/contact/contacts.html) that may be
confidential, proprietary copyrighted and/or legally privileged. It is
intended solely for the use of the individual or entity named on this
message. If you are not the intended recipient, and have received this
message in error, please notify us immediately by reply e-mail and
then delete it from your system.


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

  

Can you please elaborate with a small example? I don't get it.
Thanks

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



Define specific .properties file for bean:message /

2008-09-19 Thread Dimitris Mouchritsas

Hi all,
we have a disclaimer page in our application (using struts 1.3.8) and we 
want to display a possibly rather large legal text.
So the thought is to create a disclaimer.properties file with only one 
key in it and for that specific jsp have a
bean:message / to load this disclaimer.properties and get the key from 
there.

Is this possible?

Thanks
Dimitris

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



Disable validation when clicking back

2008-07-30 Thread Dimitris Mouchritsas

Hi all,

I have a multi-page form bean for a 2 step registration form. In the 
second page I have a back button like this:


   button name=my.company.package.BACK_BUTTON type=submit
   bean:message key=prompt.back.button /
   /button

and in my action I check if it was pressed similarly to the cancel button:

   if (isCancelled(request)) {
   targetUrl = goHome;
   } else if (isBack(request)) {
   targetUrl = goRegisterOrg;
   } else {
.
   private boolean isBack(HttpServletRequest request) {
   String back = (String)request.getParameter(EDConstants.BACK_BUTTON);

   return (back != null);
   }


My problem is, how do I disable validator from checking the form? 
Currently the user presses the back
button and validation errors show up, so he has to enter some valid 
values to go back. Any ideas?


Thanks
Dimitris

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



Form Submission of arrays

2008-07-21 Thread Dimitris Mouchritsas

Hi all,
we've got a form where there's a table. In each row there's a hidden 
field for the id, a comment (text field) and a select box.
What's the best way to submit this form? Create a form bean that will 
accept arrays as input?

e.g.

public class CommentForm {
 private String[] orgIds;
 private String[] comments;
 private String[] types;

 ...getters/setters

 public String getRow(int num) {
   return orgIds[num] + $ + comments[num] + $ + types[num];
 }
}

Is the above class correct?
Does struts guarantee that the order in which the rows are declared is 
the same order in the array when the form bean is submitted?


Thanks
Dimitris

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



Javascript validation error

2008-07-15 Thread Dimitris Mouchritsas

Hi all,
I'm trying to use javascript validation with validator, as well as 
server side validation.
Server side validation works just great. But when I try to use client 
side validation I

get a validateRequired not found error.

This is my jsp:

   html:javascript formName=LoginForm /
   html:form action=/login onsubmit=return validateLoginForm(this)

and this is the result produced from the tags:

.

   script type=text/javascript 
//![CDATA[


   var bCancel = false; 

   function validateLoginForm(form) { 
   if (bCancel) { 
   return true; 
   } else { 
   var formValidationResult; 
   formValidationResult = validateRequired(form); 
   return (formValidationResult == 1); 
   } 
   } 

   function LoginForm_required () { 
this.a0 = new Array(username, Username is required., new Function (varName,  return this[varName];));

this.a1 = new Array(password, Password is required., new Function (varName, 
 return this[varName];));
   } 



//]]
/script

form id=LoginForm method=post action=/ceproc/login.do onsubmit=return 
validateLoginForm(this)

...
Now I understand why the error happens, but where do I locate this 
validateRequired function? How do I include it in my jsp?

Thanks
Dimitris


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



Using xdoclet with ValidatorActionForm

2008-07-10 Thread Dimitris Mouchritsas

Hi all,
I've got a multipage form bean to complete a registration in 3 steps. 
Validator
is not working correctly. Some fields in the first page are validated, 
some are not.
In the 3rd page none of the fields are validated. Now from what I 
understand
I need to extend ValidatorActionForm instead of ValidatorForm. But in 
the xdoclet
path I need to provide a path attribute. (btw I use a patched 1.2.3 
xdoclet to support
struts 1.3.8) If this is the path for the action then I'm in trouble 
because I have 3 seperate

actions for each step. Do I need to combine them in one?

Could you please provide an example of how to use this path attribute?

Thanks
Dimitris

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



Re: Using xdoclet with ValidatorActionForm

2008-07-10 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Hi all,
I've got a multipage form bean to complete a registration in 3 steps. 
Validator
is not working correctly. Some fields in the first page are validated, 
some are not.
In the 3rd page none of the fields are validated. Now from what I 
understand
I need to extend ValidatorActionForm instead of ValidatorForm. But in 
the xdoclet
path I need to provide a path attribute. (btw I use a patched 1.2.3 
xdoclet to support
struts 1.3.8) If this is the path for the action then I'm in trouble 
because I have 3 seperate

actions for each step. Do I need to combine them in one?

Could you please provide an example of how to use this path attribute?

Thanks
Dimitris

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

Finally found the answer, when declaring the page attribute for the 
property in

xdoclet it has to be on the same declaration as in:

* @struts.validator type=required,mask,maxlength page=3

and not as in:
* @struts.validator type=required,mask,maxlength
* @struts.validator page=3

The latter, even though it produced a valid validation xml it added a 
null as in:


 field property=name
page=1
depends=required,mask,maxlength,null

and this messed up the validation.


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



question on multipage form bean

2008-07-08 Thread Dimitris Mouchritsas

Hi all,
I'm using a multipage form bean for a 3 page form. From what I tested, 
if I leave the pages (by following another link) and
return later the bean is still in session scope. How can I tell struts 
that I've left these pages and remove the bean from session?


I suppose if the user follows all the steps correctly I can do that in 
the final action, but what about if he clicks another link in

the meantime? I'd like to invalidate the form bean in that case as well.

Thanks
Dimitris

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



Multipage forms

2008-07-07 Thread Dimitris Mouchritsas

Hi all,
I'm starting to use multipage forms to have an organisation 
registration, along with some codes and an admin, 3 steps in total.
In the first page, I check in the action if some data from the 
organisation already exist, to give an error that the organisation is
already registered. Does this really belong there or should I move it 
after the final step and forward to the first step?


Thanks
Dimitris

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



Showing valid characters from a validator mask

2008-07-04 Thread Dimitris Mouchritsas

Hi all,
I've got a form bean for a user which has a field username (duuhhh:)
We use a mask of  ^[a-zA-Z_0-9-]*$. Is there a way I can show the
valid characters to the user? Currently the error message in
ApplicationResources properties is:

errors.invalid={0} is invalid.

and the xdoclet tags are :

   /**
* @struts.validator type=required,mask,maxlength
*
* @struts.validator-var name=maxlength value=20
* @struts.validator-var name=mask value=^[a-zA-Z_0-9-]*$
*
* @struts.validator-args arg0resource=validator.reg.username
* @struts.validator-args arg1value=${var:maxlength}
* @struts.validator-args arg2value=${var:mask}
*
* @param username The username to set.
*/
   public void setUsername(String username) {
   this.username = username;
   }

What I am fearing is if I write
errors.invalid={0} is invalid. Valid characters are {2}
all invalid validation messages will be like that.

Thanks.

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



Re: Showing messages after a redirect

2008-07-02 Thread Dimitris Mouchritsas

Adam Hardy wrote:

Dimitris Mouchritsas on 01/07/08 16:50, wrote:


Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did 
(but
it's more or less specific for the action) is to just forward, not 
redirect.
But I've got another question now? Is there a way I can pass a 
parameter in

the request? I need to pass an id for an Account when I go back to the
Prepare action. But since I'm not manipulating the url?


And you can pass a parameter in the request if you built a new Forward 
based on the one you want and construct the URL manually. I dug this 
out of an old app:


forward = mapping.findForward(origForward);
forwardName = forward.getName();
redirect = forward.getRedirect();
//change URL if different URL given
forwardUrl = /somewhere/else;
forwardUrl += ? + customQueryString;
forward = new ActionForward(forwardName, forwardUrl,
redirect);



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


Aaah, great; that seems to solve both of my problems :)
Thank you
Dimitris

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



Re: JAZN Exception when posting form with ecntype=multipart/form-data

2008-07-01 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Hi all,
we've recently upgraded our j2ee application to use struts 1.3.8 and 
we're getting a weird exception when trying to

upload a file. Here's the jsp:

testFileUpload.jsp
= 


%@ page contentType=text/html;charset=utf-8%
%@ taglib uri=/WEB-INF/tlds/struts-tiles.tld prefix=tiles%
%@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean%
%@ taglib uri=/WEB-INF/tlds/struts-html.tld prefix=html%
%@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic%

html:xhtml /

html:form method=post action=test/prepareTestFileUpload 
enctype=multipart/form-data   p

   label for=Attachment class=w33
   span class=Mandatory*/span Attachment:
   /label
   html:file property=attachment styleId=Attachment 
styleClass=w33 size=40 /

   /p
   pbutton type=submitSave changes/button/p   
/html:form
=== 


  Here's the action:

//-- 

//$Id: PrepareTestFileUploadAction.java,v 1.1 2008/06/30 12:26:53 kshe 
Exp $

//$Author: kshe $
//$Date: 2008/06/30 12:26:53 $
//$Revision: 1.1 $
//-- 


package my.company.web.actions.test;

import java.rmi.RemoteException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;


import my.company.web.actions.common.BaseAction;

import my.company.web.forms.TestUploadForm;

/**
* @custom.security-filter operation=public
*
* @struts.action path=/test/prepareTestFileUpload
*name=testUploadForm 
input=/test/prepareTestFileUpload

*
* @struts.action-forward name=goForward path=test.file.upload
*/
public class PrepareTestFileUploadAction extends BaseAction {

   private static Logger log = 
Logger.getLogger(PrepareTestFileUploadAction.class);
 
   public PrepareTestFileUploadAction()  {

   super();
   }

   public ActionForward doExecute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
   throws RepException, RemoteException {

   String forward = goForward;
   TestUploadForm testForm = (TestUploadForm)form;

   FormFile file = testForm.getAttachment();

   if (file != null) {
   log.debug(File:  + file.getFileName());
   } else {
   log.debug(File == null);
   }


   return mapping.findForward(forward);
   }
}


It seems we're able to get the filename on the server side, but when 
it tries to go forward

here's the exception we get:

Caused by: javax.servlet.ServletException: JAAS-OC4J: 
JAZNFilter.doFilter - unable to find the current servlet

   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) 

   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) 

   at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222) 

   at 
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) 

   at 
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96) 

   at 
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54) 

   at 
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) 


   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305) 


   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) 

   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
   at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) 


   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16

Re: JAZN Exception when posting form with ecntype=multipart/form-data

2008-07-01 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Dimitris Mouchritsas wrote:

Hi all,
we've recently upgraded our j2ee application to use struts 1.3.8 and 
we're getting a weird exception when trying to

upload a file. Here's the jsp:

testFileUpload.jsp
= 


%@ page contentType=text/html;charset=utf-8%
%@ taglib uri=/WEB-INF/tlds/struts-tiles.tld prefix=tiles%
%@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean%
%@ taglib uri=/WEB-INF/tlds/struts-html.tld prefix=html%
%@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic%

html:xhtml /

html:form method=post action=test/prepareTestFileUpload 
enctype=multipart/form-data   p

   label for=Attachment class=w33
   span class=Mandatory*/span Attachment:
   /label
   html:file property=attachment styleId=Attachment 
styleClass=w33 size=40 /

   /p
   pbutton type=submitSave changes/button/p   
/html:form
=== 


  Here's the action:

//-- 

//$Id: PrepareTestFileUploadAction.java,v 1.1 2008/06/30 12:26:53 
kshe Exp $

//$Author: kshe $
//$Date: 2008/06/30 12:26:53 $
//$Revision: 1.1 $
//-- 


package my.company.web.actions.test;

import java.rmi.RemoteException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;


import my.company.web.actions.common.BaseAction;

import my.company.web.forms.TestUploadForm;

/**
* @custom.security-filter operation=public
*
* @struts.action path=/test/prepareTestFileUpload
*name=testUploadForm 
input=/test/prepareTestFileUpload

*
* @struts.action-forward name=goForward path=test.file.upload
*/
public class PrepareTestFileUploadAction extends BaseAction {

   private static Logger log = 
Logger.getLogger(PrepareTestFileUploadAction.class);
 
   public PrepareTestFileUploadAction()  {

   super();
   }

   public ActionForward doExecute(ActionMapping mapping, ActionForm 
form,

   HttpServletRequest request, HttpServletResponse response)
   throws RepException, RemoteException {

   String forward = goForward;
   TestUploadForm testForm = (TestUploadForm)form;

   FormFile file = testForm.getAttachment();

   if (file != null) {
   log.debug(File:  + file.getFileName());
   } else {
   log.debug(File == null);
   }


   return mapping.findForward(forward);
   }
}


It seems we're able to get the filename on the server side, but when 
it tries to go forward

here's the exception we get:

Caused by: javax.servlet.ServletException: JAAS-OC4J: 
JAZNFilter.doFilter - unable to find the current servlet

   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663) 

   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330) 

   at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222) 

   at 
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113) 

   at 
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96) 

   at 
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54) 

   at 
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51) 

   at 
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305) 

   at 
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283) 

   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
   at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) 


   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter

Showing messages after a redirect

2008-07-01 Thread Dimitris Mouchritsas

Hi all,
I've got the following problem. I have an action that edits the details 
of a user.
When the action finishes correctly I want to show a confirmation 
message, so in the action:


ActionMessages msg = new ActionMessages();
msg.add(Constants.MESSAGE_CONFIRM, new 
ActionMessage(prompt.changes.saved));

saveMessages(request, msg);

But when I'm redirected back in the jsp there's no message showing 
(there's a specific tile for

messages). Can you please advise on how I can accomplish this?

Thank you
Dimitris



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



Re: Showing messages after a redirect

2008-07-01 Thread Dimitris Mouchritsas

Ian Roughley wrote:

my mistake, only saw the last message.

Antonio Petrelli wrote:

2008/7/1 Ian Roughley [EMAIL PROTECTED]:
 

Have you looked at the message store interceptor?



For Struts 1?

Antonio

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

Yes, for Struts 1.3.8, sorry I forgot to mention. Actually what I did 
(but it's more or less
specific for the action) is to just forward, not redirect. But I've got 
another question now?
Is there a way I can pass a parameter in the request? I need to pass an 
id for an Account
when I go back to the Prepare action. But since I'm not manipulating the 
url?


Dimitris

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



JAZN Exception when posting form with ecntype=multipart/form-data

2008-06-30 Thread Dimitris Mouchritsas

Hi all,
we've recently upgraded our j2ee application to use struts 1.3.8 and 
we're getting a weird exception when trying to

upload a file. Here's the jsp:

testFileUpload.jsp
=
%@ page contentType=text/html;charset=utf-8%
%@ taglib uri=/WEB-INF/tlds/struts-tiles.tld prefix=tiles%
%@ taglib uri=/WEB-INF/tlds/struts-bean.tld prefix=bean%
%@ taglib uri=/WEB-INF/tlds/struts-html.tld prefix=html%
%@ taglib uri=/WEB-INF/tlds/struts-logic.tld prefix=logic%

html:xhtml /

html:form method=post action=test/prepareTestFileUpload 
enctype=multipart/form-data 
  p

   label for=Attachment class=w33
   span class=Mandatory*/span Attachment:
   /label
   html:file property=attachment styleId=Attachment 
styleClass=w33 size=40 /

   /p
   pbutton type=submitSave changes/button/p   
/html:form

===
  
Here's the action:


//--
//$Id: PrepareTestFileUploadAction.java,v 1.1 2008/06/30 12:26:53 kshe Exp $
//$Author: kshe $
//$Date: 2008/06/30 12:26:53 $
//$Revision: 1.1 $
//--
package my.company.web.actions.test;

import java.rmi.RemoteException;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;


import my.company.web.actions.common.BaseAction;

import my.company.web.forms.TestUploadForm;

/**
* @custom.security-filter operation=public
*
* @struts.action path=/test/prepareTestFileUpload
*name=testUploadForm input=/test/prepareTestFileUpload
*
* @struts.action-forward name=goForward path=test.file.upload
*/
public class PrepareTestFileUploadAction extends BaseAction {

   private static Logger log = 
Logger.getLogger(PrepareTestFileUploadAction.class);
  


   public PrepareTestFileUploadAction()  {
   super();
   }

   public ActionForward doExecute(ActionMapping mapping, ActionForm form,
   HttpServletRequest request, HttpServletResponse response)
   throws RepException, RemoteException {

   String forward = goForward;
   TestUploadForm testForm = (TestUploadForm)form;

   FormFile file = testForm.getAttachment();

   if (file != null) {
   log.debug(File:  + file.getFileName());
   } else {
   log.debug(File == null);
   }


   return mapping.findForward(forward);
   }
}


It seems we're able to get the filename on the server side, but when it 
tries to go forward

here's the exception we get:

Caused by: javax.servlet.ServletException: JAAS-OC4J: 
JAZNFilter.doFilter - unable to find the current servlet

   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
   at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
   at 
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
   at 
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
   at 
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
   at 
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
   at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

   at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
   at 

Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:

A tile definition. I've tried a few combinations, but none is working. For
example if I use

  action
  path=/home
  type=be.fedict.etendering.web.actions.common.HomeAction
  forward name=home path=home redirect=true /
  /action

I get no exception but a blank page is returned.


I suppose that Tiles has not been configured correctly then.
See:
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

In particular, in the Tiles part:

  Add a chainConfig init-param in the web.xml pointing to the
location of the chain-config.xml

 init-param
 param-namechainConfig/param-name
 param-valueorg/apache/struts/tiles/chain-config.xml/param-value
 /init-param

HTH
Antonio

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


Still no luck. #*$#$!@(*$ strus :)
Anyway here's what I've done so far. Patch xdoclet 1.2.3 from
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
to allow xdoclet to create files for struts 1.3.
Updated commons-chain.jar to 1.2, commons-io.jar to 1.4. Added the 
init-param you said. Even though no exception is seen in the logs,
I get a 500 Internal server error when trying to access the home page. 
Here's my web.xml related part:


servlet
   servlet-nameaction/servlet-name
   servlet-classorg.apache.struts.action.ActionServlet/servlet-class
   init-param
 param-nameconfig/param-name
 param-value/WEB-INF/struts-config.xml/param-value
   /init-param
   init-param
 param-namechainConfig/param-name
 param-valueorg/apache/struts/tiles/chain-config.xml/param-value
   /init-param
   init-param
 param-namedebug/param-name
 param-value2/param-value
   /init-param
   init-param
 param-namedetail/param-name
 param-value2/param-value
   /init-param
   init-param
   param-nameapplication/param-name
   param-valueApplicationResources/param-value
   /init-param
   load-on-startup1/load-on-startup
/servlet

...and here's the end of struts-config.xml:

  !-- Define your Struts controller in a file called 
struts-controller.xml and place it in your merge directory. --


message-resources parameter=ApplicationResources /
message-resources parameter=ApplicationResourcesErrorMessages 
key=ERROR_RESOURCE_KEY /
message-resources parameter=ApplicationResourcesHelpMessages 
key=HELP_RESOURCE_KEY /


 plug-in className=org.apache.struts.tiles.TilesPlugin 
 set-property property=definitions-config 
value=/WEB-INF/tiles-defs.xml /

 set-property property=definitions-debug value=1/
 set-property property=definitions-parser-validate value=true /
 set-property property=moduleAware value=true /
 set-property property=definitions-parser-details value=2/
/plug-in

plug-in className=org.apache.struts.validator.ValidatorPlugIn
   set-property property=pathnames value=/WEB-INF/validator-rules.xml,
 /WEB-INF/validation.xml/
   set-property property=stopOnFirstError value=true /
/plug-in

/struts-config

See anything wrong?

Regards
Dimitris



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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

I get a 500 Internal server error when trying to access the home page.



Can I see the stack trace?

Antonio

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

  
Hm, I think we're getting close. A colleague helped me. We had an 
ErrorHandlerServlet which was

eating the exception. Now I get a meaningful 500:


 500 Internal Server Error

OracleJSP: oracle.jsp.parse.JspParseException: 
/WEB-INF/jsp/common/layout.jsp: Line # 2, %@ taglib 
uri=http://struts.apache.org/tags-tiles; prefix=t %

Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles

Take a look at my changed layout.jsp:

%@ page contentType=text/html;charset=utf-8%
%@ taglib uri=http://struts.apache.org/tags-tiles; prefix=tiles %
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
tiles:useAttribute name=title /

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

.

But why can't it find the tiles uri? I've included the 
struts-tiles-1.3.8.jar.


Dimitris

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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

OracleJSP: oracle.jsp.parse.JspParseException:
/WEB-INF/jsp/common/layout.jsp: Line # 2, %@ taglib
uri=http://struts.apache.org/tags-tiles; prefix=t %
Error: Unable to load taghandler class: http://struts.apache.org/tags-tiles
...
But why can't it find the tiles uri? I've included the
struts-tiles-1.3.8.jar.



Probably it is a caching problem (in Tomcat happens when you change
libraries). Try cleaning up the work directory (I don't really know
where it is in OC4J, sorry).

Antonio

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

  
So, since they're in the jars I don't need to declare the tld's in 
web.xml right?


Dimitris

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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

So, since they're in the jars I don't need to declare the tld's in web.xml
right?



Right, in fact I'm struggling to understand what is the problem, too :-D

Antonio

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

  

Could it be that oc4j is not loading the tld's from the jars?

Dimitris

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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas
Well, one solution is to move the tld's to a directory and define them 
in web.xml. This seems to be working.
However I've got some strange problems. For example in a tile I render a 
link for advanced search:


%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%

%--bean:define id=currentDate name=java.util.Date 
type=java.util.Date /--%

jsp:useBean id=curDate class=java.util.Date /
div id=Search
   p class=Time
   bean:message key=prompt.Greece /
   bean:write name=curDate format=HH:mm:ss zz /
   /p
   form action=#
   p
   label for=SearchSelectbean:message key=prompt.search 
/:/label

   select name=SearchSelect id=SearchSelect
   option selected=selectedSelect.../option/select
   input type=text name=SearchInput id=SearchInput 
class=Text /
   input type=submit name=SearchBTN id=SearchBTN 
class=SearchBTN value=Search /

   html:link action=prepareAdvancedSearch
   bean:message key=prompt.advanced.search /
   /html:link
   %--a href=#Advanced Search/a--%
   /p
   /form
/div!-- Search --

and I get

javax.servlet.jsp.JspException: ServletException in 
'/WEB-INF/jsp/common/search.jsp': null
at 
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927)
at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133)
[SRC:/WEB-INF/jsp/common/layout.jsp:80]

I know it's the link, because if I comment it out I get an exception on a 
different jsp and
the tile shows up.
I've also testet bean:message outside the link and it works.




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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:
Well, one solution is to move the tld's to a directory and define them 
in web.xml. This seems to be working.
However I've got some strange problems. For example in a tile I render 
a link for advanced search:


%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%

%--bean:define id=currentDate name=java.util.Date 
type=java.util.Date /--%

jsp:useBean id=curDate class=java.util.Date /
div id=Search
   p class=Time
   bean:message key=prompt.Greece /
   bean:write name=curDate format=HH:mm:ss zz /
   /p
   form action=#
   p
   label for=SearchSelectbean:message key=prompt.search 
/:/label

   select name=SearchSelect id=SearchSelect
   option selected=selectedSelect.../option/select
   input type=text name=SearchInput id=SearchInput 
class=Text /
   input type=submit name=SearchBTN id=SearchBTN 
class=SearchBTN value=Search /

   html:link action=prepareAdvancedSearch
   bean:message key=prompt.advanced.search /
   /html:link
   %--a href=#Advanced Search/a--%
   /p
   /form
/div!-- Search --

and I get

javax.servlet.jsp.JspException: ServletException in 
'/WEB-INF/jsp/common/search.jsp': null
at 
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) 

at 
org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)

at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133)
[SRC:/WEB-INF/jsp/common/layout.jsp:80]

I know it's the link, because if I comment it out I get an exception 
on a different jsp and

the tile shows up.
I've also testet bean:message outside the link and it works.




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

BTW is there an option in struts-config.xml (for v.1.3.8 at least) or 
somewhere else to notify struts to use xhtml compatible elements

everywhere? So as to avoid having html:xhtml / in every jsp?

Dimitris

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



html:link throwing null pointer

2008-06-24 Thread Dimitris Mouchritsas

Hi all,
I'm in the process of upgrading our J2EE app from struts 1.2.4 to 1.3.8. 
We're also using tiles.
I'm able to see the header tile but when it reaches the search.jsp tile 
I get:


javax.servlet.jsp.JspException: ServletException in 
'/WEB-INF/jsp/common/search.jsp': null
at 
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927)
at org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
at _web_2d_inf._jsp._common._layout._jspService(_layout.java:142)
[SRC:/WEB-INF/jsp/common/layout.jsp:81]
.
.

here's my jsp:

%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
html:xhtml /

%--bean:define id=currentDate name=java.util.Date type=java.util.Date 
/--%
jsp:useBean id=curDate class=java.util.Date /
div id=Search
   p class=Time
   bean:message key=prompt.Cyprus / 
   bean:write name=curDate format=HH:mm:ss zz /

   /p
   form action=#
   p
   label for=SearchSelectbean:message key=prompt.search /:/label 
   select name=SearchSelect id=SearchSelect

   option selected=selectedSelect.../option/select
   input type=text name=SearchInput id=SearchInput class=Text 
/
   input type=submit name=SearchBTN id=SearchBTN class=SearchBTN 
value=Search /
   html:link href=http://www.google.gr;
   bean:message key=prompt.advanced.search /
   /html:link
   %--a href=#Advanced Search/a--%
   /p
   /form
/div!-- Search --

I'm certain it's html:link, because if I comment it out the tile is showing. I've also checked with 
html:img and it shows fine, so this must be specific to html:link. Any ideas?


Thanks
Dimitris



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



Re: html:link throwing null pointer

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

javax.servlet.jsp.JspException: ServletException in
'/WEB-INF/jsp/common/search.jsp': null
   at
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927)
   at
org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)
   at _web_2d_inf._jsp._common._layout._jspService(_layout.java:142)
   [SRC:/WEB-INF/jsp/common/layout.jsp:81]



Is there a cause for this exception? Or a stack trace that appears
before this one?

Antonio

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

  

This is the stack trace following:

at com.orionserver[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
at 
org.apache.struts.tiles.commands.TilesPreProcessor.doForward(TilesPreProcessor.java:260)
at 
org.apache.struts.tiles.commands.TilesPreProcessor.execute(TilesPreProcessor.java:217)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:305)
at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:191)
at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at 
com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:196)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
at 
com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:138)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
at 
com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g 
(10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
at com.evermind[Oracle Application Server Containers for J2EE 10g

Re: html:link throwing null pointer

2008-06-24 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/24 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

I've corrected the code and I'm trying to find out how to rebuild struts.



I don't think it is necessary, it has been released in 1.3.9.
http://struts.apache.org/download.cgi#struts139

Antonio

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

  

But 1.3.9 is still beta. btw do you know when it will be released?
Anyway I've just installed the new jar and everything is working great now.
A great thank you to you Antonio, for all your support.

Dimitris

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



Re: Closing tag for html:hidden

2008-06-24 Thread Dimitris Mouchritsas

Martin wrote:

Dimitris
Congratulations..I think You found a bug

/WEB-INF/struts-config.xml
/WEB-INF/classes/ApplicationResources.properties
prompt.search=Search
prompt.Greece=Greece
prompt.advanced.search=AdvancedSearch

html
head
%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%
/head
body
bean:define id=curDate value=01-01-1970/
div id=Search
  p class=Time
  bean:message key=prompt.Greece /
  bean:write name=curDate format=HH:mm:ss zz /
  /p
  form action=#
  p
   label for=SearchSelectbean:message 
key=prompt.search/:/label

  select name=SearchSelect id=SearchSelect
  option selected=selectedSelect.../option
  /select
  input type=text name=SearchInput id=SearchInput 
class=Text /
  input type=submit name=SearchBTN id=SearchBTN 
class=SearchBTN value=Search /

  html:link action=prepareAdvancedSearch
  bean:message key=prompt.advanced.search /
  /html:link
  a href=#Advanced Search/a
  /p
  /form
/div
/body
/html

displays properly..if I change
- Original Message - From: Dimitris Mouchritsas 
[EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Tuesday, June 24, 2008 9:17 AM
Subject: Re: Closing tag for html:hidden



Dimitris Mouchritsas wrote:
Well, one solution is to move the tld's to a directory and define 
them in web.xml. This seems to be working.
However I've got some strange problems. For example in a tile I 
render a link for advanced search:


%@ taglib uri=http://struts.apache.org/tags-html; prefix=html%
%@ taglib uri=http://struts.apache.org/tags-bean; prefix=bean%

%--bean:define id=currentDate name=java.util.Date 
type=java.util.Date /--%

jsp:useBean id=curDate class=java.util.Date /
div id=Search
   p class=Time
   bean:message key=prompt.Greece /
   bean:write name=curDate format=HH:mm:ss zz /
   /p
   form action=#
   p
   label for=SearchSelectbean:message 
key=prompt.search /:/label

   select name=SearchSelect id=SearchSelect
   option selected=selectedSelect.../option/select
   input type=text name=SearchInput id=SearchInput 
class=Text /
   input type=submit name=SearchBTN id=SearchBTN 
class=SearchBTN value=Search /

   html:link action=prepareAdvancedSearch
   bean:message key=prompt.advanced.search /
   /html:link
   %--a href=#Advanced Search/a--%
   /p
   /form
/div!-- Search --

and I get

javax.servlet.jsp.JspException: ServletException in 
'/WEB-INF/jsp/common/search.jsp': null
at 
org.apache.struts.tiles.taglib.InsertTag$InsertHandler.doEndTag(InsertTag.java:927) 

at 
org.apache.struts.tiles.taglib.InsertTag.doEndTag(InsertTag.java:465)

at _web_2d_inf._jsp._common._layout._jspService(_layout.java:133)
[SRC:/WEB-INF/jsp/common/layout.jsp:80]

I know it's the link, because if I comment it out I get an exception 
on a different jsp and

the tile shows up.
I've also testet bean:message outside the link and it works.




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

BTW is there an option in struts-config.xml (for v.1.3.8 at least) or 
somewhere else to notify struts to use xhtml compatible elements

everywhere? So as to avoid having html:xhtml / in every jsp?

Dimitris

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

The bug report already exists and it's from last year, see: 
https://issues.apache.org/struts/browse/STR-3015


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



Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Hi all,
We're using struts 1.2.4 in our project and we just noticed something; 
When rendering a html:hidden element the html produced is:


input name=id value=1019 type=hidden

Notice that it doesn't close the tag properly like / as required by xhtml. Is there a way to 
tell struts to close properly for xhtml or we have to upgrade?


Thanks 
Dimitris




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



Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Notice that it doesn't close the tag properly like / as required by xhtml.
Is there a way to tell struts to close properly for xhtml or we have to
upgrade?



Use html:xhtml before the first html:* tag of every JSP page.
BTW I suggest to upgrade to Struts 1.2.9 (at least) because
html:form in Struts 1.2.4 does not produce XHTML-strict compliant
code (in particular it creates the name attribute).

Antonio

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

  
Thanks for the info for the form tag. The problem is we use tiles, so 
html:xhtml is not really an option.
A colleague will try to do a controller trick in web.xml, but from what 
I feel we'll have to upgrade.

Dimitris

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



Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Thanks for the info for the form tag. The problem is we use tiles, so
html:xhtml is not really an option.



Why? html:xhtml / does not produce any markup code, only tells
Struts tags to render in XHTML.

Antonio

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

  

Ahh, ok, confused it with html:html xhtml=true
which produces the html tag.

Anyway, I'm trying to upgrade to struts 1.3.8 but I get an exception
when trying to view the first page:

null
java.lang.NullPointerException
   at 
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)
   at 
org.apache.struts.chain.commands.servlet.PerformForward.perform(PerformForward.java:96)
   at 
org.apache.struts.chain.commands.AbstractPerformForward.execute(AbstractPerformForward.java:54)
   at 
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at 
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)

   at org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
   at 
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)

   at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
   at 
com.ed.ecomm.edcore.web.filters.SecurityFilter.doFilter(SecurityFilter.java:196)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
   at 
com.ed.ecomm.edcore.web.filters.MonitoringFilter.doFilter(MonitoringFilter.java:138)
   at 
com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
   at 
com.ed.ecomm.edcore.web.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:659)
   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
   at 
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
   at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)
   at 
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)
   at 
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)

   at java.lang.Thread.run(Thread.java:534)
-

etendering  17:15:56.265 DEBUG TilesAccessProxyAction- forwarding 
to tile definition: error.page

etendering  17:15:56.265 DEBUG ErrorHandlerServlet   - doGet
etendering  17:15:56.265 DEBUG ErrorHandlerServlet   - doPost()
etendering  17:15:56.265 ERROR ErrorHandlerServlet   - 
RepException  id:b5c7ee5ac0a8010101a8cf03a8763d4f

etendering  17:15:56.265 ERROR ErrorHandlerServlet   - EXCEPTION:
-
id b5c7ee5ac0a8010101a8cf03a8763d4f, error.generic
be.fedict.etendering.exception.EtenderingException: error.generic
   at 
be.fedict.etendering.web.servlet.ErrorHandlerServlet.logErrors(ErrorHandlerServlet.java:92)
   at 
be.fedict.etendering.web.servlet.ErrorHandlerServlet.doPost(ErrorHandlerServlet.java:53)
   at 
be.fedict.etendering.web.servlet.ErrorHandlerServlet.doGet(ErrorHandlerServlet.java:68)

   at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

   at oracle.security.jazn.oc4j.JAZNFilter$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
   at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
   at 
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
   at 
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
   at 
com.evermind.server.http.ServletRequestDispatcher.forward(ServletRequestDispatcher.java:222)
   at 
com.evermind.server.http.EvermindHttpServletResponse.handleException

Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Caused by: java.lang.NullPointerException
  at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward(PerformForward.java:113)



Mmm... Just a shot in the dark, did you put the commons-chain.jar in
your classpath?

Antonio

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

  
Yep, right from the struts lib directory. One thing to note though is 
we're using xdoclet 1.2.3 to
create struts-config.xml for us. As I understand this version of xdoclet 
supports up to struts 1.2.x.
Could this be the culprit? That it doesn't produce a proper 
struts-config.xml? Because from what I
saw web.xml is very similar to 1.3.8's web.xml from the blank web app 
example.


Dimitris

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



Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

One thing to note though is we're
using xdoclet 1.2.3 to
create struts-config.xml for us. As I understand this version of xdoclet
supports up to struts 1.2.x.
Could this be the culprit?



Probably. According to the source file:
http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_8/core/src/main/java/org/apache/struts/chain/commands/servlet/PerformForward.java
it seems that a request dispatcher is not found, that is *really*
strange, and, IMHO, can only happen when a webapp did not start
correctly. Do you see an error at startup?

Antonio

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

  
No, everything seems to start smoothly. I'll try to create a 
struts-config.xml file by hand just for the home action  and see what 
happens.


Dimitris

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



Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
 

One thing to note though is we're
using xdoclet 1.2.3 to
create struts-config.xml for us. As I understand this version of 
xdoclet

supports up to struts 1.2.x.
Could this be the culprit?



Probably. According to the source file:
http://svn.apache.org/repos/asf/struts/struts1/tags/STRUTS_1_3_8/core/src/main/java/org/apache/struts/chain/commands/servlet/PerformForward.java 


it seems that a request dispatcher is not found, that is *really*
strange, and, IMHO, can only happen when a webapp did not start
correctly. Do you see an error at startup?

Antonio

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

  
No, everything seems to start smoothly. I'll try to create a 
struts-config.xml file by hand just for the home action  and see what 
happens.


Dimitris

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


I'm not sure it's the struts-config.xml file anymore. I'm using this:

?xml version=1.0 encoding=UTF-8 ?
!DOCTYPE struts-config PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 1.3//EN
 http://struts.apache.org/dtds/struts-config_1_3.dtd;

struts-config


!--  Form Bean 
Definitions --


   form-beans
 

  
   /form-beans



!-- = Global Exception 
Definitions --


   global-exceptions
  
   /global-exceptions



!-- === Global Forward 
Definitions --


   global-forwards
  
   forward

   name=welcome
   path=/Welcome.do/
   /global-forwards


!-- === Action Mapping 
Definitions --


   action-mappings

   action

   path=/Welcome
   forward=/pages/Welcome.jsp/

   action
   path=/home
   forward=home /

   !-- sample input and input submit actions

   action
   path=/Input
   type=org.apache.struts.actions.ForwardAction
   parameter=/pages/Input.jsp/

   action
   path=/InputSubmit
   type=app.InputAction
   name=inputForm
   scope=request
   validate=true
   input=/pages/Input.jsp/

   action
   path=/edit*
   type=app.Edit{1}Action
   name=inputForm
   scope=request
   validate=true
   input=/pages/Edit{1}.jsp/

   end samples --
   /action-mappings


!--  Message Resources 
Definitions --


   message-resources parameter=MessageResources /


!-- === Plug Ins 
Configuration --



 !-- === Validator 
plugin --


 plug-in className=org.apache.struts.validator.ValidatorPlugIn
   set-property
   property=pathnames
   value=/org/apache/struts/validator/validator-rules.xml,
  /WEB-INF/validation.xml/
 /plug-in
 plug-in className=org.apache.struts.tiles.TilesPlugin
   set-property property=definitions-config 
value=/WEB-INF/tiles-defs.xml /

 /plug-in

/struts-config

which is from another 1.3.8 sample app and I just added the action 
definition for /home. Still I get the same exception.

Could it be that it's not finding a proper jar or something?

Dimitris






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



Re: Closing tag for html:hidden

2008-06-23 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/23 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

  action
  path=/home
  forward=home /



What exactly is this home?

Antonio

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

  
A tile definition. I've tried a few combinations, but none is working. 
For example if I use


   action
   path=/home
   type=be.fedict.etendering.web.actions.common.HomeAction
   forward name=home path=home redirect=true /
   /action

I get no exception but a blank page is returned.

Dimitris

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



Re: How can i user Swing as V in the Struts MVC

2008-06-16 Thread Dimitris Mouchritsas

Ehteshamul Haque wrote:

I dont know whether is it possible or not. But the question is interesting to 
me. If possible, please someone answer.


Ehteshamul Haque


'A great man is not the one who never falls, but the  one who rises every time he falls' 



--- On Sat, 6/14/08, (¯`·.k ! k !.·´¯) [EMAIL PROTECTED] wrote:
From: (¯`·.k ! k !.·´¯) [EMAIL PROTECTED]
Subject: How can i user Swing as V in the Struts MVC
To: apache struts user@struts.apache.org
Date: Saturday, June 14, 2008, 10:03 PM

Hi .. i m going to build a struts based application but i dont want to use
JSP'snbsp; instead of JSP's i want to use Swing GUI .. how can i
communicate Swing GUI with struts app and how i will get the response back ..
e.g. search results 

waiting for reply 


  


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

  
Well, I suppose you could use javascript-applet communication, but it 
seems a bit far fetched. I don't
think your architecture is correct here. Swing guis are supposed to talk 
to the business layer, not to

the controller layer.

Regards
Dimitris

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



Custom messages

2008-06-16 Thread Dimitris Mouchritsas

Hi all,
we're using struts 1.2.4 in our project and we have 3 types of messages 
to show the user:


1) Confirmational, with say a green tick mark,
2) Informational, with a classic i in a bubble
3) Error messages, with the classes red rectangle.

Currently I use saveErrors and saveMessages in my actions but that gives 
me only 2 kinds of messages;
errors and all others. Is there a way to add a 3rd type? I think I 
should do it by


errors.add(My.Custom.Identifier, );

but I'm not sure. Also, what would I need to write in the jsp. If you 
can show me some code, or

provide a link somewhere I'd be grateful.

Thanks
Dimitris


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



Re: Custom messages

2008-06-16 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/16 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Hi all,
we're using struts 1.2.4 in our project and we have 3 types of messages to
show the user:

1) Confirmational, with say a green tick mark,
2) Informational, with a classic i in a bubble
3) Error messages, with the classes red rectangle.

Currently I use saveErrors and saveMessages in my actions but that gives me
only 2 kinds of messages;
errors and all others. Is there a way to add a 3rd type? I think I should do
it by

errors.add(My.Custom.Identifier, );

but I'm not sure.



Well, this is the right thing to do :-)
In fact, saveErrors and saveMessages put the messages using special keys:
Globals.ERROR_KEY:
http://struts.apache.org/1.2.4/api/org/apache/struts/Globals.html#ERROR_KEY
Globals.MESSAGE_KEY:
http://struts.apache.org/1.2.4/api/org/apache/struts/Globals.html#MESSAGE_KEY

HTH
Antonio

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

  
Ok, I've succeeded, but in trying to have a uniform method for all 
messages I lost struts validator's errors.

For example, in the action:

   ActionMessages msg = new ActionMessages();

   msg.add(MyConstants.MESSAGE_CONFIRM, new 
ActionMessage(prompt.OK));
   msg.add(MyConstants.MESSAGE_INFO,new 
ActionMessage(prompt.modify));
   msg.add(MyConstants.MESSAGE_ERROR,   new 
ActionMessage(prompt.close));


   saveMessages(request, msg);

then in the jsp, we have a tile to show all messages, regardless of 
where they come from:


logic:messagesPresent message=true 
property=%=MyConstants.MESSAGE_CONFIRM%

   div id=Message class=Success
   %--pstrongYour changes have been accepted/strong./p--%
   html:messages id=msg message=true 
property=%=MyConstants.MESSAGE_CONFIRM%

   p
   bean:write name=msg /
   /p   
   /html:messages

   p class=Buttons
   button id=MClose type=submitbean:message 
key=prompt.close //button

   /p
   /div!-- Message // --
/logic:messagesPresent


%-- Informational Messages --%
logic:messagesPresent message=true 
property=%=MyConstants.MESSAGE_INFO%

   div id=Message class=Info

   html:messages id=msg message=true 
property=%=MyConstants.MESSAGE_INFO%
   pbean:write name=msg //p   
   /html:messages
  
   p class=Buttons
   button id=MClose type=submitbean:message 
key=prompt.close //button

   /p
   /div!-- Message // --
/logic:messagesPresent

%-- Error messages --%
logic:messagesPresent message=true 
property=%=MyConstants.MESSAGE_ERROR%

   div id=Message class=Error
   pstrongbean:message key=error.occured /:/strong/p
   ul
   html:messages id=msg message=true 
property=%=MyConstants.MESSAGE_ERROR%

   li
   bean:write name=msg /
   /li
   /html:messages
   %--
   lia href=#FNameFirst name/a is required./li
   lia href=#LNameLast name/a is required./li
   --%
   /ul   
   p class=Buttons
   button id=MClose type=submitbean:message 
key=prompt.close //button

   /p
   /div!-- Message // --
/logic:messagesPresent

But by using this method, the errors that validator adds, are not 
displayed, because they're save under Globals.ERROR_KEY.
Is there a way to tell validator to save its errors as a message under 
my own custom key? Again I point out that the only reason
I want this is to have a uniform way of dealing with messages, not 
having to use saveErrors. But if this is not correct I guess I'll

revert into using saveErrors. Any suggestions?

Regards
Dimitris



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



Provide a link from an error message

2008-06-16 Thread Dimitris Mouchritsas

Hi again,
If you've been following my threads a bit you'll see that we're 
developing an app using struts 1.2.4.
I have another question, we'd like to provide a link in some of the 
error messages. But struts seems

to change  to lt;
I know that writing html in the ApplicationResources.properties file is 
bad so I thought we'd use

parameters like:
{0}{1}{2} is required

Where {0} would be a href=...,
{1} the text for the link and
{2} /a

but still struts converts  and .

The code we use to display the errors is this:
%-- Error messages --%
logic:messagesPresent message=false
   div id=Message class=Error
   pstrongbean:message key=error.occured /:/strong/p
   ul
   html:messages id=msg message=false
   li
   bean:write name=msg /
   /li
   /html:messages
   /ul   
   p class=Buttons
   button id=MClose type=submitbean:message 
key=prompt.close //button

   /p
   /div
/logic:messagesPresent

Is there a way to do it?

Thanks
Dimitris

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



Re: Provide a link from an error message

2008-06-16 Thread Dimitris Mouchritsas

Dimitris Mouchritsas wrote:

Hi again,
If you've been following my threads a bit you'll see that we're 
developing an app using struts 1.2.4.
I have another question, we'd like to provide a link in some of the 
error messages. But struts seems

to change  to lt;
I know that writing html in the ApplicationResources.properties file 
is bad so I thought we'd use

parameters like:
{0}{1}{2} is required

Where {0} would be a href=...,
{1} the text for the link and
{2} /a

but still struts converts  and .

The code we use to display the errors is this:
%-- Error messages --%
logic:messagesPresent message=false
   div id=Message class=Error
   pstrongbean:message key=error.occured /:/strong/p
   ul
   html:messages id=msg message=false
   li
   bean:write name=msg /
   /li
   /html:messages
   /ul  p class=Buttons
   button id=MClose type=submitbean:message 
key=prompt.close //button

   /p
   /div
/logic:messagesPresent

Is there a way to do it?

Thanks
Dimitris

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


Never mind, found it, bean write name=msg filter=false /.

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



Provide links from XDoclet validator tags

2008-06-16 Thread Dimitris Mouchritsas

Hi once more,
seems like a struts day to me :)
Anyway, using struts 1.2.4 and XDoclet 1.2.3 is there a way to define an 
error message for a form which includes an argument or something?

For example:
   /**
* Set name.
*
* @param name the value to set.
*
* @struts.validator type=required,maxlength
*
* @struts.validator-var name=maxlength value=60
*
* @struts.validator-args arg0resource=prompt.reg.orgname
* @struts.validator-args arg1value=${var:maxlength}
*/
   public void setName(String name)
   {
   this.name = name;
   }

if the organisation name is missing the message produced is:
Organisation Name is missing

What I'd like to produce is:
a href=#NameOrganisation Name/a is missing.

Is there a way to do it?

Regards
Dimitris


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



Re: Is there a subtile(s)?

2008-06-05 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/4 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

The menu would look something like:
.

So in essence there are 3 seperate menus there.



Ok, you can use definition in a definition. For example:

definition name=menuContainer template=/threeRows.jsp
  put name=menu1 value=menuLogin /
  put name=menu2 value=menuAdministration /
  put name=menu3 value=menuInformation /
/definition

definition name=menuLogin template=/iterate.jsp
  !-- put your attributes here --
/definition

!-- you see the pattern :-) --

  

There
will need to be logic to hide/show specific items in each menu, according to
a user's role.



You can use a controller (a Tiles controller) to create items to show
in a JSP page.

HTH
Antonio

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

  

Hi again,
I'm having some trouble understanding your suggestion. Here's what I've 
done so far:


tiles-defs.xml:
=
   definition name=default path=/WEB-INF/jsp/layout/layout.jsp
   put name=header value=/WEB-INF/jsp/common/header.jsp/
   put name=login value=/WEB-INF/jsp/common/login.jsp/
   put name=menu value=menu.container/
   put name=openingreport 
value=/WEB-INF/jsp/common/opening_report.jsp/

   put name=alerts value=/alert.do/
   put name=body value=/WEB-INF/jsp/home.jsp/
   put name=footer value=/WEB-INF/jsp/common/footer.jsp/
   put name=scripts value=/WEB-INF/jsp/empty.jsp/
   /definition

   definition name=menu.container path=/WEB-INF/jsp/common/menu.jsp
   put name=menu1 value=menu.login /
   put name=menu2 value=menu.admin /
   put name=menu3 value=menu.info /
   /definition

   definition name=menu.login path=/WEB-INF/jsp/common/login.jsp /
   definition name=menu.admin path=/WEB-INF/jsp/common/admin.jsp /
   definition name=menu.info path=/WEB-INF/jsp/common/info.jsp /


layout.jsp:
===
div id=menu
 tiles:insert attribute=menu /
/div

menu.jsp:
==
Menu
div id=menu
   tiles:insert attribute=menu1 /
/div
div id=menu
   tiles:insert attribute=menu2 /
/div
div id=menu
   tiles:insert attribute=menu3 /
/div

While the word Menu shows up in the final page, I don't see menu1,2 or 
3. Could you please elaborate some more?

Thanks
Dimitris

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



Re: Is there a subtile(s)?

2008-06-05 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/5 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

While the word Menu shows up in the final page, I don't see menu1,2 or 3.



Your code seems ok. Do you see an error in the log?

Antonio

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

  

No, no errors on the log. :(
Dimitris

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



Re: Is there a subtile(s)?

2008-06-05 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/5 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Your code seems ok. Do you see an error in the log?

  

No, no errors on the log. :(



Does your generated HTML contain the div elements?
Can I see the code of login.jsp for example?

Antonio

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

  

Ahh, looking at the generated HTML showed the problem:
tiles:insert shouldn't be at the html :)
I had forgotten to insert the taglib definition on top of menu.jsp.
Thanks Antonio :)
Dimitris

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



Is there a subtile(s)?

2008-06-04 Thread Dimitris Mouchritsas

Hi all,
I'm searching if there's a meaning like subtiles in struts. We have one 
tile, menu, which will hold 3 menus. Should we break it into 3 
different tiles, say

menu_admin, menu_info, menu_login or can we define it in another way?
Thanks
Dimitris

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



Re: Is there a subtile(s)?

2008-06-04 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/6/4 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Hi all,
I'm searching if there's a meaning like subtiles in struts. We have one
tile, menu, which will hold 3 menus. Should we break it into 3 different
tiles, say
menu_admin, menu_info, menu_login or can we define it in another way?



What do you mean with menu here?
What version of Struts and Tiles are you using?

Antonio

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

  

We're using Struts 1.2.4. The menu would look something like:

== Logged in ===
John Doe (my role)
Last login: .
 My Profile
 My Notifications
 My homepage
 Log out

== Administration ===
 Organization Management
 User Management
 Email User


== Information ===
 News
 Statistics
.

with  I denote links. So in essence there are 3 seperate menus there. 
There will need to be logic to hide/show specific items in each menu, 
according to a user's role.


Regards
Dimitris

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



Using ActionMessages

2008-05-23 Thread Dimitris Mouchritsas

Hi all,
We use Struts 1.2.4 in our application and I'd like to refactor some 
code to use ActionMessage(s) instead of ActionError(s).
Can somebody show me a solid example (or point me to an article) on how 
to do it?


Also, when I tried before to completely remove ActionErrors, the action 
was complaining that the validate method is required

to return ActionErrors and not ActionMessages. Any workaround?
Thanks
Dimitris

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



Re: Selecting a jsp according to locale

2008-05-14 Thread Dimitris Mouchritsas

Laurie Harper wrote:

Dimitris Mouchritsas wrote:

Hi all,
I want to show a system requirements page according to the web page's 
locale.

Can I use the tiles-defs.xml to do it or I need to write code in a jsp?
Thanks


I'm not sure what you want to achieve. If you just want to localize 
the page, you can do so using the I18N facilities provided by Struts. 
If you actually need to render a different JSP per locale for some 
reason, it will be more involved. Either way, the specifics depend on 
which version of Struts you are using.


Try posting more details of exactly what it is you need to do, and 
what environment you are working in (Struts version, etc.).


L.



My version is Struts 1.2.4, running on OC4J 10.1.2.0.2 (which is pretty 
old). What I actually want to do is to display a system requirements 
page according to the user's locale which has been set before hand. So I 
suppose it would be easier to have 3 different jsp's?


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



Re: Selecting a jsp according to locale

2008-05-14 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/5/13 Dimitris Mouchritsas [EMAIL PROTECTED]:
  

Hi all,
 I want to show a system requirements page according to the web page's
locale.
 Can I use the tiles-defs.xml to do it or I need to write code in a jsp?



You can use the Tiles-included locale support. You need simply to add
the locale code in the file name. For example, if you have
tiles-defs.xml, you need to create a new tiles-defs_it_IT.xml for
Italian locale, defining only the different definitions.

HTH
Antonio
  


Ahh, thanks,  now it works. I guess I wasn't careful when reading the 
article and I had named the
file: tiles-defs-it.xml. Now with the underscore it works great! Thanks 
once again :)

Dimitris

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



Selecting a jsp according to locale

2008-05-13 Thread Dimitris Mouchritsas

Hi all,
I want to show a system requirements page according to the web page's 
locale.

Can I use the tiles-defs.xml to do it or I need to write code in a jsp?
Thanks

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



Using xdoclets and minlength from validator

2008-03-20 Thread Dimitris Mouchritsas
Hi all, I'm trying to make a password field be at least 6 characters in 
length but the check doesn't seem to work.

Here's my code:
   /**
* @struts.validator type=required,minlength,maxlength,mask
*
* @struts.validator-var name=minlength value=5
* @struts.validator-var name=maxlength value=20
* @struts.validator-var name=mask value=^[a-zA-Z_0-9-]*$
*
* @struts.validator-args arg0resource=prompt.password
* @struts.validator-args arg1value=${var:minlength}
* @struts.validator-args arg2value=${var:maxlength}
*
* @param password The password to set.
*/
  
   public void setPassword(String password) {

   this.password = password;
   }

Any ideas? Thanks


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



Implementing a back button without Javascript

2008-03-19 Thread Dimitris Mouchritsas

Hi all,
we're using struts 1.2.4 in our project and I'm trying to implement a 
back button for a 3 step registration procedure. The problem is I'd
like to do it without using javascript. I've discovered html:cancel 
which works nicely for ...canceling. But I couldn't find anything similar

for the back button. Any ideas?
Thanks

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



Re: Implementing a back button without Javascript

2008-03-19 Thread Dimitris Mouchritsas

Antonio Petrelli wrote:

2008/3/19, Dimitris Mouchritsas [EMAIL PROTECTED]:
  

we're using struts 1.2.4 in our project and I'm trying to implement a
back button for a 3 step registration procedure. The problem is I'd
like to do it without using javascript. I've discovered html:cancel
which works nicely for ...canceling. But I couldn't find anything similar
for the back button. Any ideas?





You need to manage it on the server side. There are many ways to do it, just
to mention a pair:
1) the button points to the previous action;
2) implement a history manager that manages the history of called actions
and, when called back (e.g. with a history action) you go back in the
history.

Ciao
Antonio

  
The first case would suit me fine. But how would I do this exactly? Use 
a simple button instead of html:button and include it in a a element?
I'm trying to do this as uniform as possible as with the other buttons 
which are htm:submit, html:reset and html:cancel.
My current code looks like this:
a href=%=request.getContextPath()%/home.do

 html:button styleClass=button property=back
   bean:message key=prompt.back.button /
 /html:button
/a
but I still need to add a back property to the form bean which is not 
really needed.




Managing xdoclet tags with prepare action in struts 1.2.4

2008-03-04 Thread Dimitris Mouchritsas

Hi all,
I'm trying to make some code run for a project in the company. For every 
action we have a prepare action.
The project build but when I try to access the action I get an 
application error, probably from struts. No
exception is thrown in the server log (oc4j 10.1.2 btw). Also I can see 
that the prepare action is entered.

Here's my xdoclet tags for the prepare action:
/**
* @struts.action name=prepareRegisterEOOrg path=/prepareRegisterEOOrg
*validate=false
*
* @struts.action-forward name=goRegisterEOOrg path=/registerEOOrg
*/
and here it is for the action that actually does the work:
/**
* @struts.action name=registerEOOrg path=/registerEOOrg
*validate=true input=registerEOOrg
*
* @struts.action-forward name=goHome path=/home.do redirect=true
* @struts.action-forward name=error path=/registerEOOrg
*/

The form bean has the name of RegisterEOOrgForm and the jsp is called 
registerEOOrg.jsp
Any idea what's wrong? Also please send a link if you know any tutorial 
that uses prepare

and dispatch actions, along with xdoclet. Thanks.




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