You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gregory F. March" <ma...@gfm.net> on 2004/01/22 14:13:55 UTC
Re: editor
On Jan 22, 2004, "dirk" <st...@pandora.be> wrote:
|Does anybody knows a good and free struts editor ?=20
Ob. Emacs plug...
/greg
--
Gregory F. March -=- http://www.gfm.net:81/~march -=- AIM:GfmNet
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Converting data in a ActionForm
Posted by Peter Sloots <pe...@xs4all.nl>.
Hi
I'm using the following code in a ActionForm to convert 3 strings to a Timestamp,
problem is that some of the string are null, getBirthdateMonth() is still null because setBirthdateMonth()
is called after setBirthdate(). Can someone tell me what is the right approach.
I would like to handle all the dataconversion in the form class.
Now I'm calling setBirthdate() from the Action class, to make this work.
But I don't see a way to get the values from the form before the setBirthdateMonth is called.
What is a best practice to do this kind of dataconversion.
public String getBirthdate() {
Date birthdate = null;
Timestamp ts = this.data.getBirthdate();
if (ts != null) {
birthdate = new Date(ts.getTime());
setBirthdateDay(formatDay.format(birthdate));
setBirthdateMonth(formatMonth.format(birthdate));
setBirthdateYear(formatYear.format(birthdate));
return ts.toString();
}
return null;
}
public void setBirthdate(String birthdate) {
Date date = formatBack.parse(getBirthdateYear() + "-" + getBirthdateMonth() + "-" + getBirthdateDay(), new java.text.ParsePosition(0));
Timestamp ts = null;
if (date != null) {
ts = new Timestamp(date.getTime());
this.data.setBirthdate(ts);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
RE: custom request processor
Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Fixed this by changing the order in the xml file. Now my class
EnvironmentRequestProcessor extends TilesRequestProcessor because I am using
Tiles also. But this code
protected ActionForward processActionPerform( HttpServletRequest request,
HttpServletResponse response, Action action,
ActionForm form,
ActionMapping mapping ) throws IOException,
ServletException {
if( mapping != null && mapping.getName() != null ){
System.out.println( "The action mapping is " +
mapping.getName().toString() );
}
ActionForward forward = super.processActionPerform(
request,response,action,form, mapping);
returns null. I was planning to do something based on which mapping it is.
Help appreciated.
Mohan
-----Original Message-----
From: Mohan Radhakrishnan [mailto:mradhakrishnan@cellexchange.com]
Sent: Friday, January 23, 2004 4:45 PM
To: 'Struts Users Mailing List'
Subject: custom request processor
Hi
If I have to use a custom request processor then I specify the following
<controller
processorClass="com.jea.emis.presentation.EnvironmentRequestProcessor"/>
Is there anything else I have to do ? I am using modules.
I got a parsing error.
SEVERE: Parse Error at line 51 column 14:
file:/D:/oracle9.0.4.0.1/j2ee/home/app
lications/emis/emis-web/WEB-INF/struts-config-rulemaking.xml<Line 51, Column
14>
: XML-0148: (Error) Invalid element 'controller' in content of
'struts-config',
expected elements '[message-resources, plug-in]'.
Mohan
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
custom request processor
Posted by Mohan Radhakrishnan <mr...@cellexchange.com>.
Hi
If I have to use a custom request processor then I specify the following
<controller
processorClass="com.jea.emis.presentation.EnvironmentRequestProcessor"/>
Is there anything else I have to do ? I am using modules.
I got a parsing error.
SEVERE: Parse Error at line 51 column 14:
file:/D:/oracle9.0.4.0.1/j2ee/home/app
lications/emis/emis-web/WEB-INF/struts-config-rulemaking.xml<Line 51, Column
14>
: XML-0148: (Error) Invalid element 'controller' in content of
'struts-config',
expected elements '[message-resources, plug-in]'.
Mohan
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: AW: how to show error messages in a pop up window?
Posted by Björn Moritz <bm...@gmx.de>.
You could also have a look at
http://www.servletsuite.com/servlets/strutserrortag.htm. The description mentions a popupErrorTag, which might exactly do
what you need.
Björn
> Dirk,
> I used that on my last project. In my resource bundle I had the following:
>
>
> errors.header=<script language='javascript'>alert(
> errors.footer='');</script>
>
> general.validate.date='A Date if given must be a valid Date in the
> format {0}!\\n' +
>
> Note the apostrophes and the plus sign, so that a whole series of error
> messages would pop up only in one alert.
>
> This was with <html:errors/>, that take the header and footer from the
> bundle. I'm not sure how you would adapt it to <html:messages>, but good
> luck!
>
> HTH
> Adam
>
> On 01/22/2004 03:48 PM Dirk Manske (Service Respond) wrote:
> > oh yes but the problem is that it pops up x times if x entries were
> wrong.
> > however, it should popup only once showing all wrong entries...
> >
> > my actual code cannot handle it:
> >
> > <logic:messagesPresent>
> >
> > <script language="javascript">
> >
> > <html:messages id="error">
> >
> > alert("<c:out value="${error}" />")
> >
> > </html:message>
> >
> > </script>
> >
> > </logic:messagesPresent>
> >
> >
> > any idea?
> > Dirk
> >
> >
> >
> > -----Ursprüngliche Nachricht-----
> > Von: Martin Gainty [mailto:mgainty@hotmail.com]
> > Gesendet: Donnerstag, 22. Januar 2004 15:21
> > An: Struts Users Mailing List; servicerespond.dirkmanske@nexgo.de
> > Betreff: Re: how to show error messages in a pop up window?
> >
> > Dirk-
> > did you look at javascript alert?
> > viel Glueck,
> > -Martin
> > ----- Original Message -----
> > From: "Dirk Manske (Service Respond)"
> <se...@nexgo.de>
> > To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> > Sent: Thursday, January 22, 2004 9:10 AM
> > Subject: how to show error messages in a pop up window?
> >
> >
> >
> >>Hi,
> >>
> >>I would like to display error messages in a popup window instead of
> >>the actual form page.
> >>
> >>Something like if <logic:messagesPresent> is true, pop up a window and
> >
> > show
> >
> >>the error messages.
> >>
> >>Has anyone done something similar to this and could show me an example?
> >>
> >>Thx,
> >>Dirk
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
>
>
> --
> struts 1.1 + tomcat 5.0.16 + java 1.4.2
> Linux 2.4.20 Debian
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
--
+++ GMX - die erste Adresse für Mail, Message, More +++
Bis 31.1.: TopMail + Digicam für nur 29 EUR http://www.gmx.net/topmail
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: AW: how to show error messages in a pop up window?
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Dirk,
I used that on my last project. In my resource bundle I had the following:
errors.header=<script language='javascript'>alert(
errors.footer='');</script>
general.validate.date='A Date if given must be a valid Date in the
format {0}!\\n' +
Note the apostrophes and the plus sign, so that a whole series of error
messages would pop up only in one alert.
This was with <html:errors/>, that take the header and footer from the
bundle. I'm not sure how you would adapt it to <html:messages>, but good
luck!
HTH
Adam
On 01/22/2004 03:48 PM Dirk Manske (Service Respond) wrote:
> oh yes but the problem is that it pops up x times if x entries were wrong.
> however, it should popup only once showing all wrong entries...
>
> my actual code cannot handle it:
>
> <logic:messagesPresent>
>
> <script language="javascript">
>
> <html:messages id="error">
>
> alert("<c:out value="${error}" />")
>
> </html:message>
>
> </script>
>
> </logic:messagesPresent>
>
>
> any idea?
> Dirk
>
>
>
> -----Ursprüngliche Nachricht-----
> Von: Martin Gainty [mailto:mgainty@hotmail.com]
> Gesendet: Donnerstag, 22. Januar 2004 15:21
> An: Struts Users Mailing List; servicerespond.dirkmanske@nexgo.de
> Betreff: Re: how to show error messages in a pop up window?
>
> Dirk-
> did you look at javascript alert?
> viel Glueck,
> -Martin
> ----- Original Message -----
> From: "Dirk Manske (Service Respond)" <se...@nexgo.de>
> To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
> Sent: Thursday, January 22, 2004 9:10 AM
> Subject: how to show error messages in a pop up window?
>
>
>
>>Hi,
>>
>>I would like to display error messages in a popup window instead of
>>the actual form page.
>>
>>Something like if <logic:messagesPresent> is true, pop up a window and
>
> show
>
>>the error messages.
>>
>>Has anyone done something similar to this and could show me an example?
>>
>>Thx,
>>Dirk
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Urgent: Call ActionClass from link
Posted by Manuel Lenz <Lz...@viessmann.com>.
Hi to all,
I still have the same problem and didn´t find any hint in the list archive.
I want to call an ActionClass from a Link.
This code should be run (I copied it from an archive topic):
<a class="leftnav"
href="javascript:window.open('InfoAction.do','windowName', 'status=no')">
But if I deploy this code my appServer returns an error:
[INFO] RequestProcessor - -Processing a 'GET' for path '/InfoAction'
[22.01.04 15:46:04:696 CET] 43b8e552 WebGroup X Servlet Error: :
java.lang.NullPointerException
at
org.apache.struts.util.RequestUtils.forwardURL(RequestUtils.java:1223)
But there exists an Action which has this name?
Any idea why this doesn´t work?
Manuel
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
AW: how to show error messages in a pop up window?
Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
oh yes but the problem is that it pops up x times if x entries were wrong.
however, it should popup only once showing all wrong entries...
my actual code cannot handle it:
<logic:messagesPresent>
<script language="javascript">
<html:messages id="error">
alert("<c:out value="${error}" />")
</html:message>
</script>
</logic:messagesPresent>
any idea?
Dirk
-----Ursprüngliche Nachricht-----
Von: Martin Gainty [mailto:mgainty@hotmail.com]
Gesendet: Donnerstag, 22. Januar 2004 15:21
An: Struts Users Mailing List; servicerespond.dirkmanske@nexgo.de
Betreff: Re: how to show error messages in a pop up window?
Dirk-
did you look at javascript alert?
viel Glueck,
-Martin
----- Original Message -----
From: "Dirk Manske (Service Respond)" <se...@nexgo.de>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, January 22, 2004 9:10 AM
Subject: how to show error messages in a pop up window?
>
> Hi,
>
> I would like to display error messages in a popup window instead of
> the actual form page.
>
> Something like if <logic:messagesPresent> is true, pop up a window and
show
> the error messages.
>
> Has anyone done something similar to this and could show me an example?
>
> Thx,
> Dirk
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: how to show error messages in a pop up window?
Posted by Martin Gainty <mg...@hotmail.com>.
Dirk-
did you look at javascript alert?
viel Glueck,
-Martin
----- Original Message -----
From: "Dirk Manske (Service Respond)" <se...@nexgo.de>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Thursday, January 22, 2004 9:10 AM
Subject: how to show error messages in a pop up window?
>
> Hi,
>
> I would like to display error messages in a popup window instead of the
> actual form page.
>
> Something like if <logic:messagesPresent> is true, pop up a window and
show
> the error messages.
>
> Has anyone done something similar to this and could show me an example?
>
> Thx,
> Dirk
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
how to show error messages in a pop up window?
Posted by "Dirk Manske (Service Respond)" <se...@nexgo.de>.
Hi,
I would like to display error messages in a popup window instead of the
actual form page.
Something like if <logic:messagesPresent> is true, pop up a window and show
the error messages.
Has anyone done something similar to this and could show me an example?
Thx,
Dirk
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org