Re: Scope Interceptor and Struts2 Validation query...

2011-07-06 Thread Dave Newton
The exception is being thrown from the JSP and has nothing to do with the
Java code you've shown, as far as I can tell. The error message states the
problem pretty clearly.

Dave
 On Jul 6, 2011 9:44 AM, "log2akshat"  wrote:
> Thanks for your reply.
>
> Got no success with that link
>
> Actually the main problem is that I am using different themes as well as
> modified theme as the form is having more than 2 columns, so there is a
> rendering issue if I am using the Struts validation therefore I removed
the
> Struts Validation and using my Javascript.
>
> But can you please look into my 2nd query...
>
> Thanks
> --
> Akshat
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/Scope-Interceptor-and-Struts2-Validation-query-tp4554566p4556964.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>


Re: Scope Interceptor and Struts2 Validation query...

2011-07-06 Thread log2akshat
Thanks for your reply.

Got no success with that link

Actually the main problem is that I am using different themes as well as
modified theme as the form is having more than 2 columns, so there is a
rendering issue if I am using the Struts validation therefore I removed the
Struts Validation and using my Javascript.

But can you please look into my 2nd query...

Thanks
--
Akshat

--
View this message in context: 
http://struts.1045723.n5.nabble.com/Scope-Interceptor-and-Struts2-Validation-query-tp4554566p4556964.html
Sent from the Struts - User mailing list archive at Nabble.com.

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



Re: Scope Interceptor and Struts2 Validation query...

2011-07-05 Thread Wes Wannemacher
On Tue, Jul 5, 2011 at 4:10 PM, log2akshat  wrote:
> i have implemented the Struts2 validation framework, it is working fine. But
> I want these error-messages in a small popup screen with a ok button, when
> this popup is closed the focus should go to the field that has an error.
>
> Or is there any way by which we can use additional javascript onsubmit other
> than by the dynamically generating default javascript.
>


Have a look at this and see if it helps -

http://struts.apache.org/2.2.3/docs/ajax-validation.html

-Wes

-- 
Wes Wannemacher

Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!

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



Scope Interceptor and Struts2 Validation query...

2011-07-05 Thread log2akshat
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.forward(ServletTilesRequestContext.java:241)
at
org.apache.tiles.servlet.context.ServletTilesRequestContext.dispatch(ServletTilesRequestContext.java:222)
at
org.apache.tiles.renderer.impl.TemplateAttributeRenderer.write(TemplateAttributeRenderer.java:44)
at
org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer.render(AbstractBaseAttributeRenderer.java:103)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:659)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:678)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:633)
at
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:322)
at
org.apache.struts2.views.tiles.TilesResult.doExecute(TilesResult.java:105)
at
org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:186)
at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:361)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:265)
at
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249)
at
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
at
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
at
org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)
at
org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:468)
at
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:662)

then I tried using SCOPE Interceptor and modified my struts.xml file as:






appform.CCity, state
ACTION
start
true

Apply
Apply
OLAppForm







appform.CCity, state
ACTION
start
true

OLAppForm
OLAppForm
AppFormSubmitSuccess


and tried changing city as #session[city]
but same error in the log

Since on submit my action is changing from ApplyOL.ncra to
Submitappform.ncra so how can I manage to retain the city list as well as
there is email parameter which is also showing null.

Problem using scope interceptor

2009-08-18 Thread spsarolkar

I am trying apress book example chapter06. Here is my struts.xml file







/WEB-INF/jsp/error.jsp
/WEB-INF/jsp/user/findUser-success.jsp






/WEB-INF/jsp/index.jsp







model
partialEvent








start

/WEB-INF/jsp/event/enterEventDetails-input.jsp



end

/WEB-INF/jsp/event/eventReview.jsp



Retrieve


/WEB-INF/jsp/event/selectLocationType-input.jsp





Here is my BaseEventAction.java
public class BaseEventAction extends BaseAction implements
ModelDriven {

protected Event event = null;

public Event getModel() {
return event;
}

public void setModel(Event model) {
this.event = model;
}

}

Here is my EnterEventDetailsAction.java
@ParentPackage("enterEvent")
@Result(type=
ServletActionRedirectResult.class,value="selectLocationType",params={"method","input"})
@Validation
public class EnterEventDetailsAction extends BaseEventAction implements
Preparable {

private Date partialStartDate;
private String patialStartTime;
private String partialVotingStartTime;

public void prepare() throws Exception {
event = new Event();
event.setStatus(Progress.NOT_STARTED);
event.setLastUpdateTime( Calendar.getInstance().getTime() );
}

public Date getPartialStartDate() {
return partialStartDate;
}

@RequiredFieldValidator(message="Validation Error",
key="validate.notEmpty")
public void setPartialStartDate(Date partialStartDate) {
this.partialStartDate = partialStartDate;
}

public String getPatialStartTime() {
return patialStartTime;
}

@CustomValidator(type ="timeValidator", key="validate.timeOfDay")
public void setPatialStartTime(String patialStartTime) {
this.patialStartTime = patialStartTime;
}

public String getPartialVotingStartTime() {
return partialVotingStartTime;
}

@CustomValidator(type ="timeValidator", key="validate.timeOfDay")
public void setPartialVotingStartTime(String partialVotingStartTime) {
this.partialVotingStartTime = partialVotingStartTime;
}

@VisitorFieldValidator(message="Default message", fieldName="model",
shortCircuit=false, appendPrefix=false)
public String execute() throws Exception {

Calendar cal = Calendar.getInstance();

cal.setTime(partialStartDate);
TimeUtil timeUtil = new TimeUtil(patialStartTime);
event.setStartTime( timeUtil.resolveDate( partialStartDate,
event.getTimeZoneOffset() ) );

cal = Calendar.getInstance();
cal.setTime(partialStartDate);
timeUtil = new TimeUtil(partialVotingStartTime);
event.setVotingStartTime( timeUtil.resolveDate( partialStartDate,
event.getTimeZoneOffset() ) );

return SUCCESS;

}
}

Here is my SelectLocationTypeAction.java
@ParentPackage("enterEvent")
@Result(type=
ServletActionRedirectResult.class,value="enterLocationDetails")
public class SelectLocationTypeAction extends BaseEventAction implements
Preparable {

private Integer typeId;
private List types;

public Integer getTypeId() {
return typeId;
}

public void setTypeId(Integer typeId) {
this.typeId = typeId;
}

public List getTypes() {
return types;
}

public void prepare() throws Exception {
types = new ArrayList();
types.add(new Address());
types.add(new Broadcast());
}

public String input() throws Exception {
if(event!=null)System.out.println("Event found in
EnterLocationDetails!input");
else System.out.println("Event not found in
EnterLocationDetails!input");
return INPUT;
}

}


I am not able to persist Event object across the two requests
I am getting event as 'null' in SelectLocationTypeAction.java
-- 
View this message in context: 
http://www.nabble.com/Problem-using-scope-interceptor-tp25020317p25020317.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Scope interceptor / Practical Apache Struts 2

2009-08-14 Thread spsarolkar

Hello Ian,
I am facing the same problem. 
I tried adding dependency as selkin said as follows
 

com.googlecode.struts2scopeplugin
struts2-scope-plugin
1.0.3



But printing the same error

Can you please supply me another copy of the code . 

My email address is spsarol...@gmail.com

Thanks,
Sunil


Ian Roughley wrote:
> 
> I just re-ran my local version of the code without problems, and 
> verified that the base class does have a getModel() and setModel() 
> methods.  If you contact me off-list I can supply another copy of the 
> code, that might be a resolution.  Did you have any problems running the 
> code from chapter 5?
> 
> /Ian
> 
> -- 
> Ian Roughley
> From Down & Around, Inc.
> Consulting * Training / Mentoring * Agile Process * Open Source
> web: http://www.fdar.com - email: i...@fdar.com
> 
> 
> 
> Selckin wrote:
>> Hello,
>>
>> In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It explains
>> how to use the scope interceptor to create sort of wizard pages.
>> I've been trying to figure these out, but cannot get this to work.
>> Even the included example (downloadable from
>> http://www.apress.com/book/view/1590599039 ) do not work for me.
>>
>> I was hoping someone could try them and tell me if they are indeed broken
>> or if i am doing something wrong. And what that might be?
>>
>> Running the examples with no changes and when going to the second step in
>> the workflow I get the following error:
>>
>> HTTP ERROR: 500
>> Error setting expression 'model' with value
>> 'com.fdar.apress.s2.domain.ev...@2a163765'
>>
>> RequestURI=/app/event/selectLocation!input.action
>> Caused by:
>> Error setting expression 'model' with value
>> 'com.fdar.apress.s2.domain.ev...@2a163765' - [unknown location]
>>  at
>> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
>>  at
>> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
>>  at
>> org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
>>  at
>> org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
>>  < cut >
>> Caused by: No object in the CompoundRoot has a publicly accessible
>> property named 'model' (no setter could be found). - [unknown location]
>>  at
>> com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
>>  at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
>>  at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>>  at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>> < cut > 
>> Can provide full stack trace if needed
>>
>> The following is also outputted from the example.
>>
>> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
>> caught setting 'duration' on 'class
>> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
>> expression 'duration' with value '[Ljava.lang.String;@602f892f'
>> 14-feb-2008 20:10:30
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
>> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
>> caught setting 'name' on 'class
>> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
>> expression 'name' with value '[Ljava.lang.String;@50d79dfe'
>> 14-feb-2008 20:10:30
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
>> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
>> caught setting 'timeZoneOffset' on 'class
>> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
>> expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
>> 14-feb-2008 20:10:30
>> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
>>
>> Thanks.
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>   
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Scope-interceptor---Practical-Apache-Struts-2-tp15487610p24971259.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Struts 2.1.6, Convention plugin, and Scope interceptor

2009-04-04 Thread dusty

I am not sure that I understand your problem if there is one.  

---
I have that shirt



Patrick Aikens wrote:
> 
> I'm trying to go with an all-annotation based configuration for a
> project I'm working on, and now have the desire to use a scope
> interceptor in my app.  The following is an example of my current
> ideas, but I'm not sure it's working correctly (I have a sneaking
> suspicion that I'm modifying the stack to add a second scope
> interceptor for the start and end actions rather than overriding the
> params for the existing one).  Does this work, or do I need to use XML
> to define the start and end actions like in the older Zero
> Config/Codebehind days?  I'm planning on using a single class to
> implement all the actions for this workflow (the number of screens in
> the workflow is dynamic, which is one of the reasons I want a scope
> interceptor)
> 
> Also, I want to do this in "pure" struts 2 without a third party plugin
> 
> @InterceptorRefs({
>    �...@interceptorref(value="scope", params={"session", "model", "key",
> "customModel"}),
>    �...@interceptorref("defaultStack")
> })
> public class ManageCategoryAction extends ActionSupport
>         implements ModelDriven> {
> 
>    �...@action(value="startCustomizationWorkflow",
>         interceptorre...@interceptorref(value="scope", params={"type",
> "start"})
>     )
>     public String startCustomizationWorkflow() {
> {...}
>     }
> 
> @Action(value="endCustomizationWorkflow",
> interceptorre...@interceptorref(value="scope", params={"type",
> "end"})
> )
> public String startCustomizationWorkflow() {
> {...}
> }
> 
> @Action(value="nextCustomizationWorkflowScreen")
> public String startCustomizationWorkflow() {
> {...}
> }
> 
> @Action(value="prevCustomizationWorkflowScreen")
> public String startCustomizationWorkflow() {
> {...}
> }
> }
> 
> 
> --
> SELECT * FROM users WHERE clue > 0
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Struts-2.1.6%2C-Convention-plugin%2C-and-Scope-interceptor-tp22871286p22889306.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Struts 2.1.6, Convention plugin, and Scope interceptor

2009-04-03 Thread Patrick Aikens
I'm trying to go with an all-annotation based configuration for a
project I'm working on, and now have the desire to use a scope
interceptor in my app.  The following is an example of my current
ideas, but I'm not sure it's working correctly (I have a sneaking
suspicion that I'm modifying the stack to add a second scope
interceptor for the start and end actions rather than overriding the
params for the existing one).  Does this work, or do I need to use XML
to define the start and end actions like in the older Zero
Config/Codebehind days?  I'm planning on using a single class to
implement all the actions for this workflow (the number of screens in
the workflow is dynamic, which is one of the reasons I want a scope
interceptor)

Also, I want to do this in "pure" struts 2 without a third party plugin

@InterceptorRefs({
   �...@interceptorref(value="scope", params={"session", "model", "key",
"customModel"}),
   �...@interceptorref("defaultStack")
})
public class ManageCategoryAction extends ActionSupport
        implements ModelDriven> {

   �...@action(value="startCustomizationWorkflow",
        interceptorre...@interceptorref(value="scope", params={"type", "start"})
    )
    public String startCustomizationWorkflow() {
{...}
    }

@Action(value="endCustomizationWorkflow",
interceptorre...@interceptorref(value="scope", params={"type", "end"})
)
public String startCustomizationWorkflow() {
{...}
}

@Action(value="nextCustomizationWorkflowScreen")
public String startCustomizationWorkflow() {
{...}
}

@Action(value="prevCustomizationWorkflowScreen")
public String startCustomizationWorkflow() {
{...}
}
}


--
SELECT * FROM users WHERE clue > 0

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



Help needed to use the scope interceptor for a wizard

2009-02-21 Thread Celinio Fernandes
Hi,
I am trying to implement a wizard form in Struts 2, using the SCOPE INTERCEPTOR.

That wizard is used to register a new user.
I have 3 pages :
In the first page, the user chooses a login and a password.
In the second page, the user enters his phone number, age, first name, name, 
fax.
In the third page, the user enters his adress details : country, street name, 
street number, post code.

There is one final action that is launched when the user clicks on SUBMIT in 
the third page.
This action should get all the information entered in the 3 pages and insert it 
into the database.

So far is what i have got :

First page : login.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

" rel="stylesheet" type="text/css"/>
 



 
    
         Choisissez un login et un password
    
    
     
       
     
         
       
    

    
    
    





Second page : nouvUtilisateur.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

" rel="stylesheet" type="text/css"/>
 




   
     
       
     
         
       
    
    
        
        
        
        
        
        
    
    






third page : nouvAdresse.jsp

<%@ taglib prefix="s" uri="/struts-tags" %>

" rel="stylesheet" type="text/css"/>
 




   
     
       
     
         
       
    
    
        
        
        
        
        
        
        
    
    
    





Here is what i got in struts.xml :

  
          
          
            login, password  
            start  
            
            goods: 
          
        VenteEnLigne.utilisateur 
    

     
         
         
            nom, prenom, telephone, titre, fax 
            
            goods:
         
        VenteEnLigne.adresse 
    

     
         
         
            codepostal, departement, numero, pays, rue, 
ville 
            end 
            
            goods:
         
        VenteEnLigne.inscriptionFin 
     
    

As i commented out inside struts.xml, i am a bit lost with what i should put 
inside the interceptor-ref tag.
There is little documentation and samples about its use.

Also, what exactly are the advantages of the SCOPE interceptor ?

Thanks for helping.



  

Re: Scope interceptor / Practical Apache Struts 2

2008-07-19 Thread Phan Le

Hi,
I have found and used scope plugin in [1]. It seems to be quite good  
and have most of the features I need.


1.http://cwiki.apache.org/S2PLUGINS/scope-plugin.html

On 18/07/2008, at 11:11 PM, tonalnagual wrote:





Selckin wrote:


Hello,

In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It  
explains

how to use the scope interceptor to create sort of wizard pages.
I've been trying to figure these out, but cannot get this to work.



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



Re: Scope interceptor / Practical Apache Struts 2

2008-07-18 Thread tonalnagual



Selckin wrote:
> 
> Hello,
> 
> In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It explains
> how to use the scope interceptor to create sort of wizard pages.
> I've been trying to figure these out, but cannot get this to work.
> Even the included example (downloadable from
> http://www.apress.com/book/view/1590599039 ) do not work for me.
> 
> I was hoping someone could try them and tell me if they are indeed broken
> or if i am doing something wrong. And what that might be?
> 
> Running the examples with no changes and when going to the second step in
> the workflow I get the following error:
> 
> HTTP ERROR: 500
> Error setting expression 'model' with value
> '[EMAIL PROTECTED]'
> 
> RequestURI=/app/event/selectLocation!input.action
> Caused by:
> Error setting expression 'model' with value
> '[EMAIL PROTECTED]' - [unknown location]
>   at
> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
>   at
> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
>   at
> org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
>   at
> org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
>   < cut >
> Caused by: No object in the CompoundRoot has a publicly accessible
> property named 'model' (no setter could be found). - [unknown location]
>   at
> com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
>   at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
>   at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>   at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> < cut > 
> Can provide full stack trace if needed
> 
> The following is also outputted from the example.
> 
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'duration' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'duration' with value '[Ljava.lang.String;@602f892f'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'name' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'name' with value '[Ljava.lang.String;@50d79dfe'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'timeZoneOffset' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> 
> Thanks.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Scope-interceptor---Practical-Apache-Struts-2-tp15487610p18528890.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Scope interceptor / Practical Apache Struts 2

2008-07-18 Thread tonalnagual



Selckin wrote:
> 
> Hello,
> 
> In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It explains
> how to use the scope interceptor to create sort of wizard pages.
> I've been trying to figure these out, but cannot get this to work.
> Even the included example (downloadable from
> http://www.apress.com/book/view/1590599039 ) do not work for me.
> 
> I was hoping someone could try them and tell me if they are indeed broken
> or if i am doing something wrong. And what that might be?
> 
> Running the examples with no changes and when going to the second step in
> the workflow I get the following error:
> 
> HTTP ERROR: 500
> Error setting expression 'model' with value
> '[EMAIL PROTECTED]'
> 
> RequestURI=/app/event/selectLocation!input.action
> Caused by:
> Error setting expression 'model' with value
> '[EMAIL PROTECTED]' - [unknown location]
>   at
> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
>   at
> com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
>   at
> org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
>   at
> org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
>   < cut >
> Caused by: No object in the CompoundRoot has a publicly accessible
> property named 'model' (no setter could be found). - [unknown location]
>   at
> com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
>   at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
>   at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>   at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> < cut > 
> Can provide full stack trace if needed
> 
> The following is also outputted from the example.
> 
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'duration' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'duration' with value '[Ljava.lang.String;@602f892f'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'name' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'name' with value '[Ljava.lang.String;@50d79dfe'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception
> caught setting 'timeZoneOffset' on 'class
> com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting
> expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
> 14-feb-2008 20:10:30
> com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
> 
> Thanks.
> 
> -----
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

Hi try to use.



model
partialEvent





-- 
View this message in context: 
http://www.nabble.com/Scope-interceptor---Practical-Apache-Struts-2-tp15487610p18528647.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Scope Interceptor

2008-04-20 Thread Kibo

Hi Jeromy

I understand it now. It help me the most. Thanks You very much. 

Here I find an practise for scope interceptor. Maybe it can need somebody.
http://d.hatena.ne.jp/nikkei225f/20080111/1200022384

Tomas Jurman
Czech Republic




-
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/Scope-Interceptor-tp16787023p16795377.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Scope Interceptor

2008-04-20 Thread Jeromy Evans

Kibo wrote:
Hi konference 


I read the article there:
http://struts.apache.org/2.0.9/docs/scope-interceptor.html
and a want use scope interceptor, but it not work my. I dont know exactly,
that i good understand it.
I want save into session model: Employee. 

  


Hi Tomas,

You are close to getting it to work.  There are two issues to understand:
- the ValueStack and the impact of the ModelDriven interface
- the role of the scope interceptor

ValueStack: the stack contains all the relevant objects created by the 
framework.  Normally your Action is the object at the top/root and you 
can access a property like:
 where getEmployee() is provided 
by your action.
When you enable the ModelDriven interface, instead the 
framework pushes the model (Employee) on top of the stack. Now, to 
access a property of the employee you can use this:
 (as an employee is the top of the tack, 
it accesses the employee's first name)


The stack still contains your action behind the Model and the framework 
will search it for properties that the model doesn't have.


Next, the role of the scope interceptor is to get the Model after your 
action executes and put it into the session (or another scope).  Also, 
when an action is invoked, it will also set the Model on your action by 
getting it from the session.  The reason this in an interceptor is so 
that your action and JSPs doesn't have to know; the interceptor hides 
that a session (or other scope) was used.


That means you should design your JSP as if it was populated by a normal 
ModelDriven action.


This line in your original code tries to access an object named model in 
the session.  It does need to (and shouldn't)




Instead, your model is already there (at the top of the stack that is;  either newly created or fetched for you by the interceptor) 




I hope that helps,
Jeromy Evans


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



Scope Interceptor

2008-04-19 Thread Kibo

Hi konference 

I read the article there:
http://struts.apache.org/2.0.9/docs/scope-interceptor.html
and a want use scope interceptor, but it not work my. I dont know exactly,
that i good understand it.
I want save into session model: Employee. 

//
In my Action Class I have this code:
---
public class TestScope extends ActionSupport implements
ModelDriven {

private Employee emp = new Employee(new Integer(10), "tomas", "jurman");

public Employee getModel() {
  return emp;
}

public void setModel(Employee model) {
this.emp = model;
}
}

//###
in struts.xml I have this part of code:
note: instead tag param i give here tag para because it dont show it
-

   

 model   
 true
   
   


   



 
 start
 
/jsp/start.jsp


//#
in JSP i read the session:




//###
Thanks for help very much

Tomas Jurman
Czech Republic



-
Tomas Jurman
Czech Republic
-- 
View this message in context: 
http://www.nabble.com/Scope-Interceptor-tp16787023p16787023.html
Sent from the Struts - User mailing list archive at Nabble.com.


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



Re: Scope interceptor / Practical Apache Struts 2

2008-02-14 Thread Ian Roughley
I just re-ran my local version of the code without problems, and 
verified that the base class does have a getModel() and setModel() 
methods.  If you contact me off-list I can supply another copy of the 
code, that might be a resolution.  Did you have any problems running the 
code from chapter 5?


/Ian

--
Ian Roughley

From Down & Around, Inc.

Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



Selckin wrote:

Hello,

In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It explains how 
to use the scope interceptor to create sort of wizard pages.
I've been trying to figure these out, but cannot get this to work.
Even the included example (downloadable from 
http://www.apress.com/book/view/1590599039 ) do not work for me.

I was hoping someone could try them and tell me if they are indeed broken or if 
i am doing something wrong. And what that might be?

Running the examples with no changes and when going to the second step in the 
workflow I get the following error:

HTTP ERROR: 500
Error setting expression 'model' with value '[EMAIL PROTECTED]'

RequestURI=/app/event/selectLocation!input.action
Caused by:
Error setting expression 'model' with value '[EMAIL PROTECTED]' - [unknown 
location]
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
at 
org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
at 
org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
< cut >
Caused by: No object in the CompoundRoot has a publicly accessible property 
named 'model' (no setter could be found). - [unknown location]
at 
com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
< cut > 
Can provide full stack trace if needed


The following is also outputted from the example.

SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'duration' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'duration' with value '[Ljava.lang.String;@602f892f'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'name' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'name' with value '[Ljava.lang.String;@50d79dfe'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'timeZoneOffset' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters

Thanks.

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



Scope interceptor / Practical Apache Struts 2

2008-02-14 Thread Selckin
Hello,

In Chapter 6 of "Practical Apache Struts 2 Web 2.0 Projects", It explains how 
to use the scope interceptor to create sort of wizard pages.
I've been trying to figure these out, but cannot get this to work.
Even the included example (downloadable from 
http://www.apress.com/book/view/1590599039 ) do not work for me.

I was hoping someone could try them and tell me if they are indeed broken or if 
i am doing something wrong. And what that might be?

Running the examples with no changes and when going to the second step in the 
workflow I get the following error:

HTTP ERROR: 500
Error setting expression 'model' with value '[EMAIL PROTECTED]'

RequestURI=/app/event/selectLocation!input.action
Caused by:
Error setting expression 'model' with value '[EMAIL PROTECTED]' - [unknown 
location]
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:171)
at 
com.opensymphony.xwork2.util.OgnlValueStack.setValue(OgnlValueStack.java:146)
at 
org.apache.struts2.interceptor.ScopeInterceptor.before(ScopeInterceptor.java:321)
at 
org.apache.struts2.interceptor.ScopeInterceptor.intercept(ScopeInterceptor.java:424)
< cut >
Caused by: No object in the CompoundRoot has a publicly accessible property 
named 'model' (no setter could be found). - [unknown location]
at 
com.opensymphony.xwork2.util.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:68)
at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
< cut > 
Can provide full stack trace if needed

The following is also outputted from the example.

SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'duration' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'duration' with value '[Ljava.lang.String;@602f892f'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'name' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'name' with value '[Ljava.lang.String;@50d79dfe'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters
SEVERE: ParametersInterceptor - [setParameters]: Unexpected Exception caught 
setting 'timeZoneOffset' on 'class 
com.fdar.apress.s2.actions.event.EnterEventDetailsAction: Error setting 
expression 'timeZoneOffset' with value '[Ljava.lang.String;@52a53948'
14-feb-2008 20:10:30 com.opensymphony.xwork2.interceptor.ParametersInterceptor 
setParameters

Thanks.

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



Re: Help with scope interceptor

2007-08-19 Thread j alex
Thanks Laurie for your observations..I'm having the "key" attribute in
struts xml and also setting "start" to true for the first Action ;
doing this puts the object in session, but updates to it made on the
subsequent pages are not being reflected ; ie when we print it out -
the value from session is obtained, not the one which was submitted in
the previous request.

-Josph

On 8/18/07, Laurie Harper <[EMAIL PROTECTED]> wrote:
> I haven't used the Scope interceptor, so I may not be 100% correct, but
> the following answers are based on my interpretation of the documentation:
>
> j alex wrote:
> > Hi,
> >
> > I need help regarding correct usage of Scope interceptor
> > (http://struts.apache.org/2.0.9/docs/scope-interceptor.html)
> >
> > Before going into details i had couple of qns :
> >
> > #1. Is this usable we have multiple actions sharing the same model
> > object ? - i.e each page of the app posts to a different Action . All
> > of these Actions extend from a BaseAction in which we've the get() and
> > set() for the model.
>
> Yes, provided each action is configured with a scope interceptor with
> the 'key' parameter set to the same value.
>
> > Assumptions (please correct me if i'm wrong here) :
> >
> > #2. If yes to #1, i guess we **must** provide a "key" under which to
> > save the object
>
> Yes.
>
> > #3. The Action class need not implement any special interfaces/extend
> > any classes -- right now, it extends ActionSupport.
>
> Correct.
>
> > The struts.xml is as follows :
> >
> >
> > 
> >   
> >  true
> > modelObj
> > modelObj
> >   true
> > 
> >   page-i1.jsp
> >   page-o1.jsp
> > 
> >
> > 
> >   
> >  true
> >   modelObj
> > modelObj
> >   true
> > 
> >   page-i2.jsp
> >   page-o2.jsp
> > 
> >
> >
> > The problem is that the values entered in page-i1.jsp (posting to
> > page2 Action) are not showing up in page-i2.jsp -- BUT, those were
> > showing up before the interceptor was added.
>
> Do you have the necessary getModelObj() / setModelObj() methods on
> Action1 and Action2 respectively? Have you added debug logging to
> determine if those methods are called at the appropriate points?
>
> L.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

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



Re: Help with scope interceptor

2007-08-18 Thread Laurie Harper
I haven't used the Scope interceptor, so I may not be 100% correct, but 
the following answers are based on my interpretation of the documentation:


j alex wrote:

Hi,

I need help regarding correct usage of Scope interceptor
(http://struts.apache.org/2.0.9/docs/scope-interceptor.html)

Before going into details i had couple of qns :

#1. Is this usable we have multiple actions sharing the same model
object ? - i.e each page of the app posts to a different Action . All
of these Actions extend from a BaseAction in which we've the get() and
set() for the model.


Yes, provided each action is configured with a scope interceptor with 
the 'key' parameter set to the same value.



Assumptions (please correct me if i'm wrong here) :

#2. If yes to #1, i guess we **must** provide a "key" under which to
save the object


Yes.


#3. The Action class need not implement any special interfaces/extend
any classes -- right now, it extends ActionSupport.


Correct.


The struts.xml is as follows :




   true
  modelObj
  modelObj
true  
  

page-i1.jsp
page-o1.jsp
 



   true
modelObj  
  modelObj
true  
  

page-i2.jsp
page-o2.jsp



The problem is that the values entered in page-i1.jsp (posting to
page2 Action) are not showing up in page-i2.jsp -- BUT, those were
showing up before the interceptor was added.


Do you have the necessary getModelObj() / setModelObj() methods on 
Action1 and Action2 respectively? Have you added debug logging to 
determine if those methods are called at the appropriate points?


L.


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



Help with scope interceptor

2007-08-16 Thread j alex
Hi,

I need help regarding correct usage of Scope interceptor
(http://struts.apache.org/2.0.9/docs/scope-interceptor.html)

Before going into details i had couple of qns :

#1. Is this usable we have multiple actions sharing the same model
object ? - i.e each page of the app posts to a different Action . All
of these Actions extend from a BaseAction in which we've the get() and
set() for the model.

Assumptions (please correct me if i'm wrong here) :

#2. If yes to #1, i guess we **must** provide a "key" under which to
save the object

#3. The Action class need not implement any special interfaces/extend
any classes -- right now, it extends ActionSupport.

The struts.xml is as follows :




   true
  modelObj  
  modelObj  
true  

  
page-i1.jsp
page-o1.jsp
   



   true
modelObj
  modelObj  
true  

  
page-i2.jsp
page-o2.jsp



The problem is that the values entered in page-i1.jsp (posting to
page2 Action) are not showing up in page-i2.jsp -- BUT, those were
showing up before the interceptor was added.

It'll be great if someone can help me out with this, since this is a
very basic requirement for the app i'm developing

Thanks,
Joseph

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