Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 6 Dec 2009 21:22:53 -0000 Issue 8952

user-digest-help

2009-12-06


Author LoginPost Reply

user Digest 6 Dec 2009 21:22:53 -0000 Issue 8952

Topics (messages 204101 through 204106):

Re: [ANN] Practical Apache Struts2 Web 2.0 Projects
 204101 by: VipKumar

Re: Struts HTML taglib vs. Standard HTML tags
 204102 by: Paul Benedict
 204103 by: davargas123

Re: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
 204104 by: irene zeller sancho

Ajax validation to open a conditional popup
 204105 by: Raj Malhotra

Re: RequiredFieldValidator and error message from property file via key
 204106 by: nguyenlinh

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_204101.ezm (zipped)

Hi All,

I got the issue resolved using the

<package name="enterEvent" namespace="/event" extends="base-package">

    <interceptors>
       <interceptor name="flash"
class="com.opensymphony.webwork.interceptor.FlashInterceptor" />
       
       <interceptor-stack name="eventStack">          
          <interceptor-ref name="scope">
            Model
            partialEvent
            true
          </interceptor-ref>
          <interceptor-ref name="flash"/>
          <interceptor-ref name="paramsPrepareParamsStack"/>
       </interceptor-stack>
    </interceptors>

    <default-interceptor-ref name="eventStack" />

    <action name="addEventFlow"
class="com.fdar.apress.s2.actions.event.BaseEventAction">
       <interceptor-ref name="eventStack">
          start
       </interceptor-ref>
       <result>/WEB-INF/jsp/event/enterEventDetails-input.jsp</result>
    </action>

    <action name="completeEvent"
class="com.fdar.apress.s2.actions.event.BaseEventAction">
       <interceptor-ref name="eventStack">
          end
       </interceptor-ref>
       <result>/WEB-INF/jsp/event/eventReview.jsp</result>
    </action>

     <action name="flashedSelectEventType"
class="com.fdar.apress.s2.actions.event.SelectLocationTypeAction">
        <interceptor-ref name="flash">
          Retrieve
        </interceptor-ref>
        <interceptor-ref name="eventStack" />
       <result>/WEB-INF/jsp/event/selectLocationType-input.jsp</result>
    </action>

  </package>
 


It the same configuration only thing is there are minor changes here and
there.

Thanks
Vipin
chauhan.vipin@(protected)

Jim Kiley wrote:
>
> Are you using the OpenSessionInViewFilter? If you aren't, you'll want to.
>
> If you are doing that already, you may be trying to persist when you
> should
> merge. If you're using Hibernate's API directly, take advantage of
> Hibernate's saveOrUpdate() method, rather than the JPA merge()/persiste()
> methods.
>
> Jim Kiley
> Technical Consultant
> Summa
> jhkiley@(protected)
>
>
> On Mon, Apr 28, 2008 at 3:50 PM, raxden2 <esthar_2000@(protected):
>
>>
>> HI! i had the same problem, but I have another problem:
>>
>> When i push the button for save Event... throws this exception:
>>
>> excepción
>>
>> javax.servlet.ServletException: javax.persistence.PersistenceException:
>> org.hibernate.PersistentObjectException: detached entity passed to
>> persist:
>> com.fdar.apress.s2.domain.Location
>>
>>
>> org.apache.struts2.dispatcher.Dispatcher.serviceAction (Dispatcher.java:515)
>>
>>
>> org.apache.struts2.dispatcher.FilterDispatcher.doFilter (FilterDispatcher.java:419)
>>
>>
>> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage (PageFilter.java:118)
>>
>>
>> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter (PageFilter.java:52)
>>
>>
>> org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter (ActionContextCleanUp.java:99)
>>
>> causa raíz
>>
>> javax.persistence.PersistenceException:
>> org.hibernate.PersistentObjectException: detached entity passed to
>> persist:
>> com.fdar.apress.s2.domain.Location
>>
>>
>> org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException (AbstractEntityManagerImpl.java:629)
>>
>>
>> org.hibernate.ejb.AbstractEntityManagerImpl.persist (AbstractEntityManagerImpl.java:218)
>>
>>
>> com.fdar.apress.s2.services.EventServiceImpl.create(EventServiceImpl.java:24)
>>
>>
>> com.fdar.apress.s2.actions.event.SaveEventAction.execute(SaveEventAction.java:32)
>>     sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>
>> ..............
>>
>> causa raíz
>>
>> org.hibernate.PersistentObjectException: detached entity passed to
>> persist:
>> com.fdar.apress.s2.domain.Location
>>
>>
>> org.hibernate.event.def.DefaultPersistEventListener.onPersist (DefaultPersistEventListener.java:79)
>>     org.hibernate.impl.SessionImpl.firePersist (SessionImpl.java:609)
>>     org.hibernate.impl.SessionImpl.persist (SessionImpl.java:601)
>>
>> org.hibernate.engine.CascadingAction$8.cascade(CascadingAction.java:295)
>>     org.hibernate.engine.Cascade.cascadeToOne (Cascade.java:268)
>>     org.hibernate.engine.Cascade.cascadeAssociation (Cascade.java:216)
>>     org.hibernate.engine.Cascade.cascadeProperty (Cascade.java:169)
>>
>> ..........
>>
>> I need help, i don´t know how resolve this.
>>
>>
>> Thanks.
>>
>>
>>
>>
>>
>> Ian Roughley wrote:
>> >
>> > I'm not sure, and I'm only taking an educated guess at it being
>> > OS/platform-dependent (since a JAR that worked for me had problems for
>> > another user). Unfortunately I can't reproduce the error. I'm all for
>> > doing the work to fix the problem if someone has the problem and cycles
>> > to work through testing it.
>> >
>> > /Ian
>> >
>> > Dave Newton wrote:
>> >> --- Ian Roughley <ian@(protected):
>> >>
>> >>> The solution provided to me was to change the scope interceptor
>> >>> reference to use a session value of "Model" rather than "model" - see
>> >>> below.
>> >>>
>> >>>  <interceptor-ref name="scope">
>> >>>   Model
>> >>>   partialEvent
>> >>>  </interceptor-ref>
>> >>>
>> >>
>> >> Hmm, why does that fix it? If it's an OS-dependent issue we should fix
>> it
>> >> for
>> >> real.
>> >>
>> >> Dave
>> >>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> >> For additional commands, e-mail: user-help@(protected)
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-ANN--Practical-Apache-Struts2-Web-2.0-Projects-tp13863084p16945872.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)
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>

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



Attachment: user_204102.ezm (zipped)
Did you check your server logs? I bet the problem is the taglib uri.

See the TLD URIs section:
http://wiki.apache.org/struts/StrutsUpgradeNotes12to13

Paul

On 12/4/2009 1:41 PM, davargas123 wrote:
>
> When I change the standard HTML tags of my .jsp page into the Struts tags,
> the page loads up completely blank, aside from what is loaded by the
> tiles-def. What could be causing this? I'm thinking that's why my page
> doesn't submit data to the actionform, but I don't see why it wouldn't be
> rendering the struts tags at all. For instance, if I even add ONE struts tag
> in the middle of my working code that isn't the html:form tag, the entire
> jsp page will not be rendered at all. It's driving me nuts, I've been
> working on figuring this out for far too long and would greatly appreciate
> some input.
>
>
> ---------------------------JSP---------------------------------------
> <%@(protected)"%>
> <%@(protected)"%>
> <%@(protected)"
> %>


Attachment: user_204103.ezm (zipped)

I did check those to see if they had anything to do with it, but those aren't
the problem. I literally copied them straight from another page in the same
web app that I'm adding my page to. The page I'm doing is part of a larger
web app that already has a number of jsp pages which include struts tags and
work perfectly fine, but when I use the tags I totally lose all of the
rendering. It's very odd, and I don't understand how I'm running into this
problem based on what I've been reading about how to make your jsp pages and
use strugs tags.



Paul Benedict-2 wrote:
>
> Did you check your server logs? I bet the problem is the taglib uri.
>
> See the TLD URIs section:
> http://wiki.apache.org/struts/StrutsUpgradeNotes12to13
>
> Paul
>
> On 12/4/2009 1:41 PM, davargas123 wrote:
>>
>> When I change the standard HTML tags of my .jsp page into the Struts
>> tags,
>> the page loads up completely blank, aside from what is loaded by the
>> tiles-def. What could be causing this? I'm thinking that's why my page
>> doesn't submit data to the actionform, but I don't see why it wouldn't be
>> rendering the struts tags at all. For instance, if I even add ONE struts
>> tag
>> in the middle of my working code that isn't the html:form tag, the entire
>> jsp page will not be rendered at all. It's driving me nuts, I've been
>> working on figuring this out for far too long and would greatly
>> appreciate
>> some input.
>>
>>
>> ---------------------------JSP---------------------------------------
>> <%@(protected)"%>
>> <%@(protected)"%>
>> <%@(protected)
>> import="com.thomson.west.pubrec.optout.ui.servlet.SSNLookupAction"
>> %>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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



Attachment: user_204104.ezm (zipped)
You can use google guice (
http://www.tzavellas.com/techblog/2007/07/03/using-dependency-injection-in-struts2-for-stateless-ejbs-part-1/).
I use it and works fine!


2009/12/4 Haroon Rafique <haroon.rafique@(protected)>

> On Today at 11:58am, JC=>James Cook <James.Cook@(protected):
>
> JC> EJB's can only be injected into other EJB's or Servlets, a struts 2
> JC> action is essentially a pojo not a servlet. So you would either have to
> JC> do a lookup in the context, or if you are using Spring look at using a
> JC> jndi lookup and inject that reference into your class.
> JC>
> JC> Cookie
>
> Celinio,
>
> You can also use a Servlet simply for the purpose of invoking EJBs (let's
> call it EJBInvokerServlet) and then use the @Resource notation to bring
> any local EJB into your Action. See:
> http://osdir.com/ml/user-struts.apache.org/2009-07/msg00842.html
>
> Hope that helps.
>
> JC>
> JC> -----Original Message-----
> JC> From: Fernandes Celinio [mailto:cfernandes@(protected)]
> JC> Sent: 04 December 2009 11:37
> JC> To: user@(protected)
> JC> Subject: [Struts 2 + EJB 3] injection of EJBs into struts 2 actions
> JC>
> JC> Hi,
> JC> I know that it is not possible to inject EJB in Struts 2 actions.
> JC> The following annotation would not work :
> JC> @EJB
> JC> MyBeanLocal mybean;
> JC>
> JC> But how come ? Since a Struts action is a servlet and injection works
> in
> JC> a servlet, injection should work.
> JC>
> JC> Thanks for enlightening me.
> JC>
> JC>
> JC> ---------------------------------------------------------------------
> JC> To unsubscribe, e-mail: user-unsubscribe@(protected)
> JC> For additional commands, e-mail: user-help@(protected)
> JC>
> JC>
>
> --
> Haroon Rafique
> <haroon.rafique@(protected)>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_204105.ezm (zipped)
Hi
My current functionality is to send the form values as request parameteres
to server where it will be first validated using xml and then Action will
process the request to save the values in the database.
Now i want to add the 'download to excel' functionality.User can key in the
values in form and can click on this download button to get the data in
excel sheet.But now i have to do same validation and saving in this case
also.
So i thought of using ajax to send the request as usual to the server and if
i recieve the error show it on the jsp else on successfully saving the form
values.open a window popup to download the excel sheet.
Is my approach correct.IF so please provide me some details or pointer so
that i can implement this.In case if there is better appraoch then this,i
will love to hear from you.
Thanks
Raj

Attachment: user_204106.ezm (zipped)

Hello,
I have the same problem. So what kind of validator should I use if I have a
field of type int and I want to make sure the user typed a number?
Thanks,
Linh


Greg Lindholm-2 wrote:
>
> You may have a different problem then you think;
>
> The @RequiredFieldValidator does not make any sense on a int
> (primitive) field as an int cannot be null. The validation interceptor
> checks the values on the fields after params interceptor sets the
> fields. The RequiredFieldValidator checks if the field is null which
> will never be the case for a primitive field.
>
>

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


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