Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 12 Aug 2008 10:52:13 -0000 Issue 8189

user-digest-help

2008-08-12


Author LoginPost Reply

user Digest 12 Aug 2008 10:52:13 -0000 Issue 8189

Topics (messages 189918 through 189939):

Re: Struts 2 and radio buttons
 189918 by: Ramanathan RV
 189919 by: Ramanathan RV
 189920 by: Ramanathan RV

The execute method of my Action is executed twice
 189921 by: ElCrackdel83

Re: [Struts 2] NetBeans can't find my ResourceBundle properties file (localization issue)
 189922 by: Dave Newton
 189923 by: Ylva Degerfeldt

[S2] using SSL; configuration error
 189924 by: xianwinwin
 189937 by: Anastasios Patrikis

Re: Remotely passing parameters to struts
 189925 by: Randy Burgess
 189931 by: jaki

How start with multilanguage app
 189926 by: Felipe Lorenz
 189927 by: Dave Newton

Re: not displaying Action errors
 189928 by: Richard Yee
 189932 by: Umar Bilal
 189933 by: Narasimha Raju Naidu

Re: How to resolve list property for ModelDriven Action?
 189929 by: Haulyn R. Jason

Re: Simplified usage of:@(protected)
 189930 by: ravi_eze

[S2] Proper way to clear error messages in session scope
 189934 by: Diego Manilla Suárez

Re: append value inside <:iterator
 189935 by: holod

tabbed panels with Struts 2.1.2
 189936 by: André Cedik | GDG

@DateRangeFieldValidator max=currentDate
 189938 by: holod

Problem displaying jsp after form submitting
 189939 by: holod

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------

Attachment: user_189918.ezm (zipped)
Hi,

I would rather suggest you write some CSS code to achieve this. Something as
simple like

label {
display: block;
}

should work. Changing a theme only makes sense when you need to make some
drastic changes like modifying layout of forms.

On Sun, Aug 10, 2008 at 1:48 AM, Michael Finney <finney@(protected):

> Thank you. I was wondering about CSS. I had not considered extending the
> theme. That's a nice idea. :)
>
> Digging into themes is something I should consider more often perhaps.
>
>
> --
> Michael Finney - "Always Striving To Serve You Better Every Day"
> finney@(protected)
> http://www.SmilingSoftwareSolutions.com
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Saturday, August 09, 2008 1:04 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 and radio buttons
>
> --- On Sat, 8/9/08, Michael Finney <finney@(protected):
> > Using the simple theme, how do:
> >     o I get radio buttons in a group to be vertically listed?
>
> You can play some CSS games, or extend/modify the theme and change the
> template. (There are probably other options too, but those are probably the
> easiest.)
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.6.0/1601 - Release Date: 8/8/2008
> 9:02 AM
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Thanks
Ram

Attachment: user_189919.ezm (zipped)
Hi,

I would rather suggest you write some CSS code to achieve this. Something as
simple like

label {
display: block;
}

should work. Changing a theme only makes sense when you need to make some
drastic changes like modifying layout of forms.

On Sun, Aug 10, 2008 at 1:48 AM, Michael Finney <finney@(protected):

> Thank you. I was wondering about CSS. I had not considered extending the
> theme. That's a nice idea. :)
>
> Digging into themes is something I should consider more often perhaps.
>
>
> --
> Michael Finney - "Always Striving To Serve You Better Every Day"
> finney@(protected)
> http://www.SmilingSoftwareSolutions.com
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Saturday, August 09, 2008 1:04 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 and radio buttons
>
> --- On Sat, 8/9/08, Michael Finney <finney@(protected):
> > Using the simple theme, how do:
> >     o I get radio buttons in a group to be vertically listed?
>
> You can play some CSS games, or extend/modify the theme and change the
> template. (There are probably other options too, but those are probably the
> easiest.)
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.6.0/1601 - Release Date: 8/8/2008
> 9:02 AM
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Thanks
Ram

Attachment: user_189920.ezm (zipped)
Hi,

I would rather suggest you write some CSS code to achieve this. Something as
simple like

label {
display: block;
}

should work. Changing a theme only makes sense when you need to make some
drastic changes like modifying layout of forms.

On Sun, Aug 10, 2008 at 1:48 AM, Michael Finney <finney@(protected):

> Thank you. I was wondering about CSS. I had not considered extending the
> theme. That's a nice idea. :)
>
> Digging into themes is something I should consider more often perhaps.
>
>
> --
> Michael Finney - "Always Striving To Serve You Better Every Day"
> finney@(protected)
> http://www.SmilingSoftwareSolutions.com
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Saturday, August 09, 2008 1:04 PM
> To: Struts Users Mailing List
> Subject: Re: Struts 2 and radio buttons
>
> --- On Sat, 8/9/08, Michael Finney <finney@(protected):
> > Using the simple theme, how do:
> >     o I get radio buttons in a group to be vertically listed?
>
> You can play some CSS games, or extend/modify the theme and change the
> template. (There are probably other options too, but those are probably the
> easiest.)
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
> No virus found in this incoming message.
> Checked by AVG - http://www.avg.com
> Version: 8.0.138 / Virus Database: 270.6.0/1601 - Release Date: 8/8/2008
> 9:02 AM
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Thanks
Ram

Attachment: user_189921.ezm (zipped)

Hi!

I'm writing because of a problem I have, and I think it has to do with a
problem in Struts. I use Struts 1.3.8, Ubuntu, Netbeans 6.0 and JDK 6. The
problem started as a NullPointerException, but after hours and hours trying
everything I realized that my execute method is executed twice. Why do I get
a NullPointer? Because what the action does is to delete an user in the DB,
and before that I print the name of the user, and, of course, the second
time I get a null when I go to the DB to get that user.

I've checked in the rest of my Actions, and this one is the only one that is
executed twice .

Please, if someone can help I'd be so grateful. In the following paragraphs
you can see the parts of code that are involved on this.

struts-config.xml
=============
<action path="/DeleteUserAdminAction" type="actions.DeleteUserAdminAction"
validate="false">
       <forward name="Success"
path="/WEB-INF/jsps/user/deletedUser.jsp"/>            
</action>

JSP with the link DeleteUserAdminAction.do
================================
<logic:iterate id="user" name="users" scope="request">
    <tr>
       <td>${user.login}</td>
       <td>${user.nombre}</td>
       <td>${user.apellidos}</td>
       <td>${user.role}</td>
       <td>
          <html:link href="#" title="Ver en Detalle este Usuairo"
onclick="window.open('UserDetailAction.do?id_usuario=${user.id_usuario}&pop=yes',
'Ven en detalle Datos del Usuario',
'height=850,width=900,scrollbars=1,status=1,resizable=0')"><html:image
src="${pageContext.request.contextPath}/im/ic_eye.gif" /></html:link>
          <logic:equal value="Administrador" name="usuario"
property="role" scope="session">
            &nbsp;&nbsp;                
            <javi:encryptUrl
urlBeforeQuestionMark="GoToUpdateUserFormAdminAction.do"
urlAfterQuestionMark="id_usuario=${user.id_usuario}" pageVar="urlUpdate"/>
            <html:link href="${urlUpdate}" title="Actualizar los
datos asociados a este Usuario"><html:image
src="${pageContext.request.contextPath}/im/ic_open_win.gif" /></html:link>
            &nbsp;&nbsp;
            <javi:encryptUrl
urlBeforeQuestionMark="DeleteUserAdminAction.do"
urlAfterQuestionMark="id_usuario=${user.id_usuario}" pageVar="urlDelete"/>
            <html:link href="${urlDelete}" title="Eliminar a este
Usuario de la Aplicación"><html:image
src="${pageContext.request.contextPath}/im/ic_remove.gif" /></html:link>
          </logic:equal>
       </td>
    </tr>    
</logic:iterate>

The execute of the Action
===================
    ActionForward forward = null;
         
    long id_usuario =
Long.parseLong(Utils.decryptParameter("id_usuario", request));
    UsuarioDao usuarioDao = new UsuarioDao();
    Usuario usuario = usuarioDao.selectUserById(id_usuario);
           
    usuarioDao.deleteUser(id_usuario);
   
    log.info("El Usuario " + usuario.getNombre() + " " +
usuario.getApellidos() + " ha sido eliminado de la Aplicación. Acción
realizada por el usuario: " +
          "" +
((Usuario)request.getSession().getAttribute("usuario")).getNombre() + " " +
((Usuario)request.getSession().getAttribute("usuario")).getApellidos());    
         
    forward = mapping.findForward("Success");
   
    return forward;

The JSP after the Action executes the execute method
=========================================
El Usuario ha sido eliminado correctamente de la Base de Datos.
<br/>
<html:link href="ListAllUsersAction.do" title="Pulsar para volver a listar
todos los usuarios"><html:button property="" value="Vovler a Listar Todos
los Usuarios"/></html:link>



Seriously, this problem is driving me crazy. I've tried everything, and I
don't see where the problem is.

Thanks a lot in advance.

Regards.
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189922.ezm (zipped)
--- On Mon, 8/11/08, Ylva Degerfeldt <ylva.degerfeldt@(protected):
> Well the action that should be executed after a submit from
> the first page (called "NameAndCv.jsp") extends ActionSupport.
>
> But maybe this problem is due to another thing I'm
> insecure about...
>
> I run my application just by the Run command of NetBeans,
> having set the welcome-file tag to "NameAndCv.jsp" in
> web.xml. Your question reminded me that I'm unsure about
> how to actually start the application (yes, I'm a complete
> newbie about Struts 2). Do I have to start by calling an
> action (and not by calling a JSP), and how do I do
> that? Is there some standard, already defined action that I
> can call (since this action only has to return "success"
> and nothing else)?

If you're calling a JSP page directly (almost never a good idea) it won't go through the action request process, so you won't have anything on the value stack. Most S2 tags depends on something being on the value stack--like <s:text...>.

You can configure an action without a class and S2 will use (normally) ActionSupport, the default execute() method returns "success":

<action name="foo">
<result>/WEB-INF/jsps/foo.jsp</result>
</action>

> And how do I tell NetBeans that it should start by running an action?

I'm not sure how to answer that; all NetBeans will do is start the application server, and you make requests to the app.

Dave


Attachment: user_189923.ezm (zipped)
Thanks a lot for answering again, Dave!
I felt that my latest questions hardly deserved an answer since they
were too basic. For that reason I have been reading some stuff myself
to try to find answers.. (See below.)

> If you're calling a JSP page directly (almost never a good idea) it won't go through the action request process, so you won't have anything on the value stack. Most S2 tags depends on something being on the value stack--like <s:text...>.
Yes, I suspected something like that.

> You can configure an action without a class and S2 will use (normally) ActionSupport, the default execute() method returns "success":
>
> <action name="foo">
> <result>/WEB-INF/jsps/foo.jsp</result>
> </action>

Yes, I just read about that, but I didn't know that Struts
automatically uses ActionSupport in this case. Good to know. Then I
understand.

>> And how do I tell NetBeans that it should start by running an action?
>
> I'm not sure how to answer that; all NetBeans will do is start the application server, and you make requests to the app.
Ok, I'll try to find that out by myself.

/Ylva

>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189924.ezm (zipped)

Hi all,

I downloaded the SSL plugin from
http://code.google.com/p/struts2-ssl-plugin/

I added the jar to my application path and as the tutorial describes:

"The plug-in extends struts-default so you can extend the "ssl-default"
package to get these additional features." /under usage

I simply changed my "security-default.xml"

from
<package name="security-default" namespace="/" extends="struts-default">

to
<package name="security-default" namespace="/" extends="ssl-default">

but the application throws an exception:

Struts Problem Report
Struts has detected an unhandled exception:

Messages: There is no Action mapped for namespace / and action name
register_forwardPage.



--------------------------------------------------------------------------------

Stacktraces
There is no Action mapped for namespace / and action name
register_forwardPage. - [unknown location]
 
com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:186)
 
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:41)
 
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:494)
 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:202)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
 
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213)
 
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
 
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126)
 
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
 
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
 
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148)
 
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:869)
 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527)
 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:80)
 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
  java.lang.Thread.run(Unknown Source)




I tried to add other lines to the xml file such as
    <interceptor-stack name="SecureStack">
    <interceptor-ref name="secure">
       false
     </interceptor-ref>
     <interceptor-ref name="defaultStack"/>
    </interceptor-stack>


but I keep getting the same error message.

can anyone advise why this happens?

thank you!
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189937.ezm (zipped)
Hello.

I added a new package definition into my struts.xml file like this:

 <package name="withSsl" extends="ssl-default" namespace="/secured">
   <interceptors>
     <interceptor-stack name="SecureStack">
       <interceptor-ref name="defaultStack"/>
       <interceptor-ref name="secure">
         <param name="useAnnotations">true</param>
         <param name="httpPort">8080</param>
         <param name="httpsPort">8443</param>
       </interceptor-ref>
     </interceptor-stack>
   </interceptors>

   <action name="ManagePortalLogin" class="com.XXXX" method="portalLogin">
     <result name="error">/login/Error.jsp</result>
     <result>/login/Success.jsp</result>
   </action>
 </package>

The namespace of the package is "/secured", so the name of the action is "/secured/ManagePortalLogin.action".
All my other actions that do not need SSL are in the package "/", so this actions are called like "/DoSomething.action".

This works fine, so the only configuration was in my struts.xml file.

I receive a error message like yours when I call a action that is not defined in my struts.xml file or the namespace for the action is wrong.

I hope this helps.
Regards,

Anastasios.


-----Ursprüngliche Nachricht-----
Von: xianwinwin [mailto:xianwinwin@(protected)]
Gesendet: Montag, 11. August 2008 22:07
An: user@(protected)
Betreff: [S2] using SSL; configuration error


Hi all,

I downloaded the SSL plugin from
http://code.google.com/p/struts2-ssl-plugin/

I added the jar to my application path and as the tutorial describes:

"The plug-in extends struts-default so you can extend the "ssl-default"
package to get these additional features." /under usage

I simply changed my "security-default.xml"

from
<package name="security-default" namespace="/" extends="struts-default">

to
<package name="security-default" namespace="/" extends="ssl-default">

but the application throws an exception:

Struts Problem Report
Struts has detected an unhandled exception:

Messages: There is no Action mapped for namespace / and action name
register_forwardPage.



--------------------------------------------------------------------------------

Stacktraces
There is no Action mapped for namespace / and action name
register_forwardPage. - [unknown location]
 
com.opensymphony.xwork2.DefaultActionProxy.prepare (DefaultActionProxy.java:186)
 
org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy (StrutsActionProxyFactory.java:41)
 
org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:494)
 
org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (ApplicationFilterChain.java:202)
 
org.apache.catalina.core.ApplicationFilterChain.doFilter (ApplicationFilterChain.java:173)
 
org.apache.catalina.core.StandardWrapperValve.invoke (StandardWrapperValve.java:213)
 
org.apache.catalina.core.StandardContextValve.invoke (StandardContextValve.java:178)
 
org.apache.catalina.core.StandardHostValve.invoke (StandardHostValve.java:126)
 
org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:105)
 
org.apache.catalina.core.StandardEngineValve.invoke (StandardEngineValve.java:107)
 
org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148)
 
org.apache.coyote.http11.Http11Processor.process (Http11Processor.java:869)
 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket (PoolTcpEndpoint.java:527)
 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt (LeaderFollowerWorkerThread.java:80)
 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
  java.lang.Thread.run(Unknown Source)




I tried to add other lines to the xml file such as
    <interceptor-stack name="SecureStack">
    <interceptor-ref name="secure">
       false
     </interceptor-ref>
     <interceptor-ref name="defaultStack"/>
    </interceptor-stack>


but I keep getting the same error message.

can anyone advise why this happens?

thank you!
--
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_189925.ezm (zipped)
You can refactor your action so that the business logic in your action
resides elsewhere, then expose that business logic using Spring/web
services, EJB or really any remoting technology.

Regards,
Randy Burgess
Sr. Software Architect
D5 Systems, LLC


> From: jaki <jackie_james@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Mon, 11 Aug 2008 08:45:37 -0700 (PDT)
> To: <user@(protected)>
> Subject: Remotely passing parameters to struts
>
>
> Hi all,
>
> I have a web application which needs to pass parameters to a struts app
> which resides on another machine. I will not be calling the struts class
> using a jsp but from a normal java method. So, is there a way to pass
> arguements without using a request/response object?
> --
> View this message in context:
> http://www.nabble.com/Remotely-passing-parameters-to-struts-tp18928369p1892836
> 9.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



Attachment: user_189931.ezm (zipped)

What's the way to do it using request/response then? I tried it out with
requestdispatcher only to later find out that requestdispatcher can only
forward to servlets within the same web app. Is there a way to make it
forward to a remote servlet?

jaki wrote:
>
> Hi all,
>
> I have a web application which needs to pass parameters to a struts app
> which resides on another machine. I will not be calling the struts class
> using a jsp but from a normal java method. So, is there a way to pass
> arguements without using a request/response object?
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189926.ezm (zipped)
Hi people.

I want to learn about multilanguages applications selected by user,
but i dont know how!? I tried google... but nothing concrete about
it....

Somebody have a tutorial? Or something to help me?!

I think the user can change language in the "index" jsp, by a
configuration or in any jsp(if possible)..


Thks in advice.
Felipe.

Attachment: user_189927.ezm (zipped)
--- On Mon, 8/11/08, Felipe Lorenz <felipe.lorenz@(protected):
> I want to learn about multilanguages applications selected
> by user, but i dont know how!? I tried google... but nothing
> concrete about it....
>
> Somebody have a tutorial? Or something to help me?!

http://struts.apache.org/2.x/docs/localization.html
http://struts.apache.org/2.x/docs/i18n-interceptor.html

Dave


Attachment: user_189928.ezm (zipped)
Have you debugged your code with a source level debugger? Are you sure
that the error messages are getting added?

-R

Narasimha Raju Naidu wrote:
> thanks for your reply. but itz not working. im getting the same output. for
> reference im sending screen shot of that output please check once.
>
>
> Regards,
> -------------
>
> On Sun, Aug 10, 2008 at 9:55 PM, Richard Yee <ryee@(protected):
>
>  
>> You are using == to test string equality instead of equals()
>> -R
>>
>> Sent from my iPhone
>>
>>
>> On Aug 8, 2008, at 11:52 PM, "Narasimha Raju Naidu" <feel2work@(protected)>
>> wrote:
>>
>> hi to all,
>>  
>>>     im sending my code please check where i am doing mistake
>>>
>>> form.jsp
>>> ---------------
>>> <%@(protected)"%>
>>> <html:errors/>
>>> <div style="background-color:#fcc;border: 1px dashed
>>> blue;width:280px;margin:2px;">
>>> <html:form action="/login.do">
>>> <table cellpadding=2 align=center
>>> style="font-family:verdana;font-size:15;">
>>>
>>> <tr><td><b>User Name</b></td>
>>> <td><html:text property="userName"/></td></tr>
>>> <tr>
>>> <td><b>Password</b></td>
>>> <td><html:password property="pwd"/></td></tr>
>>> <tr><td>
>>> <html:submit property="submit" value="Connect"/></td><td>
>>> <html:reset property="reset" value="Re-Try"/></td></tr>
>>> </table>
>>> </html:form>
>>> </div>
>>>
>>> -------------------------------------------------------------------------
>>> formbean
>>> ---------------------------
>>> import javax.servlet.http.*;
>>> import org.apache.struts.action.*;
>>>
>>> public class LoginBean extends ActionForm
>>> {
>>>  private String userName;
>>>  private String pwd;
>>>
>>>  public void setUserName(String userName)
>>>  {
>>>   this.userName=userName;
>>>  }
>>>  public String getUserName()
>>>  {
>>>   return userName;
>>>  }
>>>  public void setPwd(String pwd)
>>>  {
>>>   this.pwd=pwd;
>>>  }
>>>  public String getPwd()
>>>  {
>>>   return pwd;
>>>  }
>>>
>>>  public void reset(ActionMapping mapping,HttpServletRequest request)
>>>  {
>>>   System.out.println("--reset LoginForm--");
>>>   this.userName="";
>>>   this.pwd="";
>>>  }
>>>
>>>  public ActionErrors validate(ActionMapping mapping,HttpServletRequest
>>> request)
>>>  {
>>>   ActionErrors aes=new ActionErrors();
>>>   if(userName==null||userName=="")
>>>   {
>>>     aes.add("userName",new ActionError("UserName is Required"));
>>>   }
>>>   if(pwd==null||pwd=="")
>>>   {
>>>     aes.add("pwd",new ActionError("Password is Required"));
>>>   }
>>>   return aes;
>>>  }
>>> }
>>>
>>> --------------------------------------------------------------
>>> action class
>>> ----------------------
>>>
>>> import javax.servlet.http.*;
>>> import org.apache.struts.action.*;
>>>
>>>
>>> public class LoginAction extends Action
>>> {
>>>  public ActionForward execute(ActionMapping mapping,ActionForm
>>> form,HttpServletRequest request,HttpServletResponse response) throws
>>> Exception
>>>  {
>>>   LoginBean login= (LoginBean)form;
>>>   return mapping.findForward("succ");
>>>  }
>>> }
>>>
>>> -------------------------------------------------------------------
>>> struts-config.xml code
>>> ------------------------------
>>> <form-beans>
>>>  <form-bean name="LBBean" type="LoginBean"/>
>>> </form-beans>
>>>
>>>
>>> <action path="/login" type="LoginAction" name="LBBean" scope="request"
>>> input="/pages/login.jsp" validate="true">
>>>  <forward name="succ" path="/pages/succ.jsp"/>
>>> </action>
>>>
>>>
>>> while compiling im not getting any errors while running if i did not give
>>> any input i am getting bullet not the exact error what i gave. waiting for
>>> you people's valuable replys.
>>>
>>> Regards,
>>>
>>> Narasimha Raju
>>>
>>>
>>>
>>>
>>> uni...
>>>
>>>    
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
>
>
> uni...
>
>  


Attachment: user_189932.ezm (zipped)


Hello this is regarding your Bean Validation. Yesterday I only checked
if everything was right meaning that it wont submit the form until you
pass the validation. I didn't realize you wanted the messages to come on
the page anyway do the following

Add these lines to your ApplicationProperties

null.checkId = {0} cannot be null or empty

null.checkPwd ={0} does not pass the validation rules

And this is your valiadtion Method

public ActionErrors validate
 (
    ActionMapping mapping,
    HttpServletRequest request )
 {

    ActionErrors errors = new ActionErrors();      

    if( getUserName().length()<1 )
    {
     errors.add("name",new ActionError("null.checkId","UserName"));
    }
   
    if( getPwd().length()<1 )
    {
     errors.add("password",new
ActionError("null.checkPwd","Password"));
    }
   return errors;
 }
And write this on your login jsp infront of your fields or anywhere else
where you want to display the message

<html:errors property="name"/>
<html:password property="pwd" />

That will solve your issue
take care
Bye

-----Original Message-----
From: Richard Yee [mailto:ryee@(protected)]
Sent: Tuesday, August 12, 2008 7:48 AM
To: Struts Users Mailing List
Subject: Re: not displaying Action errors

Have you debugged your code with a source level debugger? Are you sure
that the error messages are getting added?

-R

Narasimha Raju Naidu wrote:
> thanks for your reply. but itz not working. im getting the same
> output. for reference im sending screen shot of that output please
check once.
>
>
> Regards,
> -------------
>
> On Sun, Aug 10, 2008 at 9:55 PM, Richard Yee <ryee@(protected):
>
>  
>> You are using == to test string equality instead of equals() -R
>>
>> Sent from my iPhone
>>
>>
>> On Aug 8, 2008, at 11:52 PM, "Narasimha Raju Naidu"
>> <feel2work@(protected)>
>> wrote:
>>
>> hi to all,
>>  
>>>     im sending my code please check where i am doing mistake
>>>
>>> form.jsp
>>> ---------------
>>> <%@(protected)/>
>>> <div style="background-color:#fcc;border: 1px dashed
>>> blue;width:280px;margin:2px;"> <html:form action="/login.do"> <table

>>> cellpadding=2 align=center
>>> style="font-family:verdana;font-size:15;">
>>>
>>> <tr><td><b>User Name</b></td>
>>> <td><html:text property="userName"/></td></tr> <tr>
>>> <td><b>Password</b></td> <td><html:password
>>> property="pwd"/></td></tr> <tr><td> <html:submit property="submit"
>>> value="Connect"/></td><td> <html:reset property="reset"
>>> value="Re-Try"/></td></tr> </table> </html:form> </div>
>>>
>>> --------------------------------------------------------------------
>>> -----
>>> formbean
>>> ---------------------------
>>> import javax.servlet.http.*;
>>> import org.apache.struts.action.*;
>>>
>>> public class LoginBean extends ActionForm {
>>>  private String userName;
>>>  private String pwd;
>>>
>>>  public void setUserName(String userName)
>>>  {
>>>   this.userName=userName;
>>>  }
>>>  public String getUserName()
>>>  {
>>>   return userName;
>>>  }
>>>  public void setPwd(String pwd)
>>>  {
>>>   this.pwd=pwd;
>>>  }
>>>  public String getPwd()
>>>  {
>>>   return pwd;
>>>  }
>>>
>>>  public void reset(ActionMapping mapping,HttpServletRequest
request)
>>>  {
>>>   System.out.println("--reset LoginForm--");
>>>   this.userName="";
>>>   this.pwd="";
>>>  }
>>>
>>>  public ActionErrors validate(ActionMapping
>>> mapping,HttpServletRequest
>>> request)
>>>  {
>>>   ActionErrors aes=new ActionErrors();
>>>   if(userName==null||userName=="")
>>>   {
>>>     aes.add("userName",new ActionError("UserName is Required"));
>>>   }
>>>   if(pwd==null||pwd=="")
>>>   {
>>>     aes.add("pwd",new ActionError("Password is Required"));
>>>   }
>>>   return aes;
>>>  }
>>> }
>>>
>>> --------------------------------------------------------------
>>> action class
>>> ----------------------
>>>
>>> import javax.servlet.http.*;
>>> import org.apache.struts.action.*;
>>>
>>>
>>> public class LoginAction extends Action {
>>>  public ActionForward execute(ActionMapping mapping,ActionForm
>>> form,HttpServletRequest request,HttpServletResponse response) throws

>>> Exception
>>>  {
>>>   LoginBean login= (LoginBean)form;
>>>   return mapping.findForward("succ");
>>>  }
>>> }
>>>
>>> -------------------------------------------------------------------
>>> struts-config.xml code
>>> ------------------------------
>>> <form-beans>
>>>  <form-bean name="LBBean" type="LoginBean"/> </form-beans>
>>>
>>>
>>> <action path="/login" type="LoginAction" name="LBBean"
scope="request"
>>> input="/pages/login.jsp" validate="true">
>>>  <forward name="succ" path="/pages/succ.jsp"/>
>>> </action>
>>>
>>>
>>> while compiling im not getting any errors while running if i did not
give
>>> any input i am getting bullet not the exact error what i gave.
waiting for
>>> you people's valuable replys.
>>>
>>> Regards,
>>>
>>> Narasimha Raju
>>>
>>>
>>>
>>>
>>> uni...
>>>
>>>    
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>  
>
>
>
> uni...
>
>  


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


Attachment: user_189933.ezm (zipped)
Thanks to all. my problem was resolved. thanks a lot.


Regards,



On Tue, Aug 12, 2008 at 11:51 AM, Umar Bilal <ubilal@(protected):

>
>
> Hello this is regarding your Bean Validation. Yesterday I only checked
> if everything was right meaning that it wont submit the form until you
> pass the validation. I didn't realize you wanted the messages to come on
> the page anyway do the following
>
> Add these lines to your ApplicationProperties
>
> null.checkId = {0} cannot be null or empty
>
> null.checkPwd ={0} does not pass the validation rules
>
> And this is your valiadtion Method
>
> public ActionErrors validate
>  (
>     ActionMapping mapping,
>     HttpServletRequest request )
>  {
>
>     ActionErrors errors = new ActionErrors();
>
>     if( getUserName().length()<1 )
>     {
>      errors.add("name",new ActionError("null.checkId","UserName"));
>     }
>
>     if( getPwd().length()<1 )
>     {
>      errors.add("password",new
> ActionError("null.checkPwd","Password"));
>     }
>    return errors;
>  }
> And write this on your login jsp infront of your fields or anywhere else
> where you want to display the message
>
> <html:errors property="name"/>
> <html:password property="pwd" />
>
> That will solve your issue
> take care
> Bye
>
> -----Original Message-----
> From: Richard Yee [mailto:ryee@(protected)]
> Sent: Tuesday, August 12, 2008 7:48 AM
> To: Struts Users Mailing List
> Subject: Re: not displaying Action errors
>
> Have you debugged your code with a source level debugger? Are you sure
> that the error messages are getting added?
>
> -R
>
> Narasimha Raju Naidu wrote:
> > thanks for your reply. but itz not working. im getting the same
> > output. for reference im sending screen shot of that output please
> check once.
> >
> >
> > Regards,
> > -------------
> >
> > On Sun, Aug 10, 2008 at 9:55 PM, Richard Yee <ryee@(protected):
> >
> >
> >> You are using == to test string equality instead of equals() -R
> >>
> >> Sent from my iPhone
> >>
> >>
> >> On Aug 8, 2008, at 11:52 PM, "Narasimha Raju Naidu"
> >> <feel2work@(protected)>
> >> wrote:
> >>
> >> hi to all,
> >>
> >>>     im sending my code please check where i am doing mistake
> >>>
> >>> form.jsp
> >>> ---------------
> >>> <%@(protected)/>
> >>> <div style="background-color:#fcc;border: 1px dashed
> >>> blue;width:280px;margin:2px;"> <html:form action="/login.do"> <table
>
> >>> cellpadding=2 align=center
> >>> style="font-family:verdana;font-size:15;">
> >>>
> >>> <tr><td><b>User Name</b></td>
> >>> <td><html:text property="userName"/></td></tr> <tr>
> >>> <td><b>Password</b></td> <td><html:password
> >>> property="pwd"/></td></tr> <tr><td> <html:submit property="submit"
> >>> value="Connect"/></td><td> <html:reset property="reset"
> >>> value="Re-Try"/></td></tr> </table> </html:form> </div>
> >>>
> >>> --------------------------------------------------------------------
> >>> -----
> >>> formbean
> >>> ---------------------------
> >>> import javax.servlet.http.*;
> >>> import org.apache.struts.action.*;
> >>>
> >>> public class LoginBean extends ActionForm {
> >>>  private String userName;
> >>>  private String pwd;
> >>>
> >>>  public void setUserName(String userName)
> >>>  {
> >>>   this.userName=userName;
> >>>  }
> >>>  public String getUserName()
> >>>  {
> >>>   return userName;
> >>>  }
> >>>  public void setPwd(String pwd)
> >>>  {
> >>>   this.pwd=pwd;
> >>>  }
> >>>  public String getPwd()
> >>>  {
> >>>   return pwd;
> >>>  }
> >>>
> >>>  public void reset(ActionMapping mapping,HttpServletRequest
> request)
> >>>  {
> >>>   System.out.println("--reset LoginForm--");
> >>>   this.userName="";
> >>>   this.pwd="";
> >>>  }
> >>>
> >>>  public ActionErrors validate(ActionMapping
> >>> mapping,HttpServletRequest
> >>> request)
> >>>  {
> >>>   ActionErrors aes=new ActionErrors();
> >>>   if(userName==null||userName=="")
> >>>   {
> >>>     aes.add("userName",new ActionError("UserName is Required"));
> >>>   }
> >>>   if(pwd==null||pwd=="")
> >>>   {
> >>>     aes.add("pwd",new ActionError("Password is Required"));
> >>>   }
> >>>   return aes;
> >>>  }
> >>> }
> >>>
> >>> --------------------------------------------------------------
> >>> action class
> >>> ----------------------
> >>>
> >>> import javax.servlet.http.*;
> >>> import org.apache.struts.action.*;
> >>>
> >>>
> >>> public class LoginAction extends Action {
> >>>  public ActionForward execute(ActionMapping mapping,ActionForm
> >>> form,HttpServletRequest request,HttpServletResponse response) throws
>
> >>> Exception
> >>>  {
> >>>   LoginBean login= (LoginBean)form;
> >>>   return mapping.findForward("succ");
> >>>  }
> >>> }
> >>>
> >>> -------------------------------------------------------------------
> >>> struts-config.xml code
> >>> ------------------------------
> >>> <form-beans>
> >>>  <form-bean name="LBBean" type="LoginBean"/> </form-beans>
> >>>
> >>>
> >>> <action path="/login" type="LoginAction" name="LBBean"
> scope="request"
> >>> input="/pages/login.jsp" validate="true">
> >>>  <forward name="succ" path="/pages/succ.jsp"/>
> >>> </action>
> >>>
> >>>
> >>> while compiling im not getting any errors while running if i did not
> give
> >>> any input i am getting bullet not the exact error what i gave.
> waiting for
> >>> you people's valuable replys.
> >>>
> >>> Regards,
> >>>
> >>> Narasimha Raju
> >>>
> >>>
> >>>
> >>>
> >>> uni...
> >>>
> >>>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >>
> >>
> >
> >
> >
> > uni...
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--

uni...

Attachment: user_189929.ezm (zipped)
Dave Newton :
> Oh. So what are you asking then? How to create a select list? How to use the <s:select...> tag?
>
> Dave
>
> --- On Mon, 8/11/08, Haulyn R. Jason <saharabear@(protected):
>
>  
>> From: Haulyn R. Jason <saharabear@(protected)>
>> Subject: Re: How to resolve list property for ModelDriven Action?
>> To: "Struts Users Mailing List" <user@(protected)>
>> Date: Monday, August 11, 2008, 12:35 PM
>> Dave Newton :
>>  
>>> --- On Mon, 8/11/08, Haulyn R. Jason
>>>    
>> <saharabear@(protected):
>>  
>>>  
>>>    
>>>> I implement ModelDriven interface, but I have a
>>>>      
>> list in my
>>  
>>>> model. It
>>>> looks like:
>>>> public class Role(){
>>>> private String id;
>>>> private String name ;
>>>> private List<Privilege> privilegeList;
>>>> }
>>>>
>>>> In my action, I have a set/get method for Role
>>>>      
>> Object, but
>>  
>>>> what about the list?
>>>>  
>>>>      
>>> You don't need a separate method for the list; if
>>>    
>> you're using ModelDriven you'd get it, for example,
>> by using:
>>  
>>> <s:iterator value="privilegeList">
>>>  ...
>>>
>>> The model (when not null) is pushed onto the top of
>>>    
>> the stack. If you weren't using ModelDriven and had a
>> getter for role:
>>  
>>> <s:iterator
>>>    
>> value="role.privilegeList">
>>  
>>>  ...
>>>
>>>
>>> Dave
>>>
>>>
>>>
>>>    
>> ---------------------------------------------------------------------
>>  
>>> To unsubscribe, e-mail:
>>>    
>> user-unsubscribe@(protected)
>>  
>>> For additional commands, e-mail:
>>>    
>> user-help@(protected)
>>  
>>>  
>>>    
>> Thanks Dave, but
>> It's a form, I want to use <select
>> multiple="true" > or the similar ui
>> tags for modifying it. So how can I retrieve data from
>> form?
>>
>> --
>>
>> Thanks!
>>
>> Mobile: +086-15864011231
>> EMail&gtalk:saharabear@(protected)
>> EMail&yahoo:jia_haolin@(protected)
>> Skype:saharabear
>>
>>
>> Haulyn Runner Jason
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail:
>> user-help@(protected)
>>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>  
Hi, Dave
Sorry for my poor English, I am not english speaking.
I mean , I know how to populate data to a select tag, and I know how to
collection data from a select tag, but the problem is:
If the list I want to collection from select tag is not a simple data
type(String), but it's another object, how can I do that?

Thanks


--

Thanks!

Mobile: +086-15864011231
EMail&gtalk:saharabear@(protected)
EMail&yahoo:jia_haolin@(protected)
Skype:saharabear


Haulyn Runner Jason


Attachment: user_189930.ezm (zipped)

hi,

Thanks for the reply.

We had done with the old approach (@com....@(protected)
write an interceprotor read the constants (through java reflections) and put
them in request scope. THe page can access them from there. The problem with
this is that the action class variable names shouldnt conflict with
constants names. We got this idea a few days back. Though we didnt validate
it i see this as a potential soln.

Any how thanks once again for your help. I shall try to use it.

regards,
ravi


ravi_eze wrote:
>
> hi,
>
> we want to access the constants in our jsp page. So we are proceeding as
> follows:
>
> < s:text field name="map[@com.company.Constants@(protected)]" />
>
> the problem with this is that we need to repeat the @com.company.Constants
> always. So is there a simple way to get this working? I wanted to try out
> <S:bean and <s:Push... but no luck...
>
> i tried out this way:
>
> < s:bean name="com.company.framework.Constants" id="C" ></s:bean>
> < s:property value="#C.POKER_TOTAL_DEPOSITS" />
>
> please help.
>
> cheers,
> ravi
>
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189934.ezm (zipped)
Hi. I have an action in session scope. The problem is that action errors
are never cleared and thus are shown repeatedly whenever the user sends
the form with validation errors.

At first I put a call to clearErrors() at the beginning of mi validate()
method, but now I'm using also the validation framework, so if I do
that, I'm clearing its validation errors too before they are even shown.

I think the right place to clear errors would be right after they are
printed, but I don't see any tag to do that.

Thanks in advance.

Attachment: user_189935.ezm (zipped)



holod wrote:
>
> I use <s:iterator/>
> inside this tag I want to compose a String.
> I've tried this one:
>      <s:set name="representativeIds" value="" scope="page"/>
>        <s:iterator value="lawDraft.representatives">
>          <s:if test="id != 0">
>            <s:property value="'id=' + id"/>
>            <s:set name="representativeIds" value="#representativeIds + id +
> ';'"/>
>            <s:property value="'set=' + #representativeIds"/>
>          </s:if>
>        </s:iterator>
>
> <s:property value="'id=' + id"/> shows me that my iterator works and I
> have several id != 0
> <s:property value="'set=' + #representativeIds"/> always shows set=null
>
> seems like I'm on the wrong way. Is it possible to solve such task using
> struts tags?
>

I have to use lambda-fucntions of OGNL :
http://struts.apache.org/2.0.11.2/docs/ognl.html
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189936.ezm (zipped)
Hi everyone,

has anyone tried using tabbed panels with Struts 2.1.2?
http://struts.apache.org/2.1.2/docs/tabbedpanel.html

When I'm testing the example on the Struts website I always
receive errors from the debugger the there's a collision on
the widgets' id even when I'm not specifying one.

Attachment: user_189938.ezm (zipped)

 @TypeConversion(converter = "project.action.admin.converter.DateConverter")
 @RequiredFieldValidator(message="Please, enter date. Field can't be empty")
 //@(protected)()}",
message = "date must be between ${min} and ${max}, current value is
${dateIntro}.")
 public void setDateIntro(Date dateIntro) {
   this.dateIntro = dateIntro;
 }

project.action.admin.converter.DateConverter presents date as String
"dd.MM.yyyy" and vise versa.
I want my DateRangeFieldValidato to compare dateIntro with fixed min and
dynamic current date.
Is it possible?
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189939.ezm (zipped)

I have an action:
<action name="StoreLawDraft"
class="project.action.admin.StoreLawDraftAction">
 <result name="success" type="chain">
          ShowMainPage
         /admin
     </result>  
  <result name="input">/admin/processlaw.jsp</result>
     <result name="error">/admin/processlaw.jsp</result>
</action>

if success it chains to:

    <action name="ShowMainPage"
class="project.action.admin.EmptyAction">
       <result name="success">/admin/catalog.jsp</result>
 </action>

My project.action.admin.StoreLawDraftAction sets actionMessage.
project.action.admin.EmptyAction does nothing. Just returns
ActionSupport.SUCCESS
These both actions extends ActionSupport.
I want catalog.jsp to display actionMessage which has been set inside
project.action.admin.StoreLawDraftAction.

The problem is that after chaining catalog.jsp is not correctly displayed.
Seems like it is not rendered properly. Non of the JavaScrips loaded, none
of the css loaded. It displays plain html. And nothibg else.
My browser url = http://applicationContectPath/StoreLawDraft.action

If I use redirect-action instead of chainng, catalog.jsp is fine, but
actionMessage was lost because of redirection.

What I'm doing wrong?

P.S.

If I use
<result name="success">/admin/catalog.jsp</result> instead of chaining or
riderection, catalog.jsp is also badly rendered, just plain html.

Please, help!
--
Sent from the Struts - User mailing list archive at Nabble.com.

©2008 gg3721.com - Jax Systems, LLC, U.S.A.