dependent scrolls

2008-12-14 Thread hello_everyone
Hi,

Is it possible to connect two scroll, when user scrolls one the other one
also scrolls.

i am using struts 1.x

Regards


RE: Please help! Validation Errors

2008-12-14 Thread Martin Gainty

can we see the struts action mappings and result mappings from struts.xml e.g.?
i assume you're using Struts 2?




hello.jsp



Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business 
of Sender. This transmission is of a confidential nature and Sender does not 
endorse distribution to any party other than intended recipient. Sender does 
not necessarily endorse content contained within this transmission. 




> Date: Mon, 15 Dec 2008 09:47:33 +0800
> From: farazali.fa...@gmail.com
> To: user@struts.apache.org
> Subject: Re: Please help! Validation Errors
> 
> Any idea?
> 
> On Fri, Dec 12, 2008 at 6:04 PM, Faraz Ali  wrote:
> 
> > Hi Andy,
> >
> > Please take a look at the code snippet and suggest.
> >
> > *MyAction.java*
> > public class MyAction extends ActionSupport {
> >  //getAction
> >  //setAction
> >  public String execute() throws Exception {
> >   if(action==1) {
> >return "input";
> >   } elseif(action==2) {
> >return "showResult";
> >   } else {
> >return "success";
> >   }
> >  }
> > }
> >
> > *struts.xml:*
> > 
> >  
> >   /jsps/showResult.jsp
> >   /jsps/inputPage.jsp
> >   /jsps/successPage
> >  
> > 
> >
> > *index.jsp:*
> > 
> >  2
> > 
> >
> > In my index.jsp, i am calling action to display showResult.jsp page. But
> > dont know why it is displaying inputPage.jsp. I also put a breakpoint in my
> > Action class and start the application in debug mode, but the execute method
> > did not called.
> > Please tell me whats happening? If you need more information please tell me
> >
> >   On Thu, Dec 11, 2008 at 4:04 AM, Andy Sykes  wrote:
> >
> >> Faraz,
> >>
> >> I think at this point some code would help. Could you post your
> >> struts.xml, and the action?
> >>
> >> Andy.
> >>
> >> On 10 Dec 2008, at 17:16, Faraz Ali wrote:
> >>
> >>  Yes Andy, you are right. I added the , but why it
> >>> is
> >>> executing automatically. It is executed automatically when i start my
> >>> application.
> >>>
> >>> On Wed, Dec 10, 2008 at 6:19 PM, Andy Sykes  wrote:
> >>>
> >>>  Faraz,
> 
>  When using validation, the input result tells Struts where to
>  dispatch/redirect to if there's a validation error. When you submit the
>  form, Struts checks the fields against the validation XML - if there's
>  an
>  error, it adds FieldError objects to the FieldErrors object on the value
>  stack, and dispatches to the JSP (or other resource) defined in the
>  input
>  result element. This is nearly always the JSP containing the form you
>  submitted from.
> 
>  You have to have a  because Struts has to know
>  where
>  to redirect in the event of a validation error.
> 
>  Not sure what you mean by the last bit of your question..
> 
>  Andy.
> 
> 
> 
>  On 10 Dec 2008, at 05:56, Faraz Ali wrote:
> 
>  13:45:18,390 ERROR [ActionComponent] Could not execute action:
> 
> > /web/MyAction
> > No result defined for action com.web.actions.MyAction and result input
> > -
> > action - file:/C:/
> > jboss-4.2.3.GA/server/default/tmp/deploy/tmp35854MyWeb-exp.war/WEB-
> > <
> > http://jboss-4.2.3.ga/server/default/tmp/deploy/tmp35854MyWeb-exp.war/WEB->
> >
> > INF/classes/struts.xml:12:69
> >
> > 1. I have a simple Action class MyAction
> > 2. A corresponding MyAction-validation.xml present in same location as
> > Action class
> > 3.  is included in jsp
> > 4. No  is present
> >
> > My Question is why do we need this input element? Because i want to
> > control
> > it my way. And if i add this input element, its opening the jsp page at
> > the
> > start of the application. Can anybody help me how to do validation
> > properly
> > in struts2 application?
> >
> > --
> > Best Regards,
> > Faraz Ali
> >
> >
> 
>  -
>  To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>  For additional commands, e-mail: user-h...@struts.apache.org
> 
> 
> 
> >>>
> >>> --
> >>> Best Regards,
> >>> Faraz Ali
> >>>
> >>
> >>
> >> -
> >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> >> For additional commands, e-mail: user-h...@struts.apache.org
> >>
> >>
> >
> >
> > --
> > Best Regards,
> > Faraz Ali
> >
> 
> 
> 
> -- 
> Best Regards,
> Faraz Ali

_
Send e-mail faster without improving your typing skills.
http://windowslive.com/Explore/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008

Re: Please help! Validation Errors

2008-12-14 Thread Faraz Ali
Any idea?

On Fri, Dec 12, 2008 at 6:04 PM, Faraz Ali  wrote:

> Hi Andy,
>
> Please take a look at the code snippet and suggest.
>
> *MyAction.java*
> public class MyAction extends ActionSupport {
>  //getAction
>  //setAction
>  public String execute() throws Exception {
>   if(action==1) {
>return "input";
>   } elseif(action==2) {
>return "showResult";
>   } else {
>return "success";
>   }
>  }
> }
>
> *struts.xml:*
> 
>  
>   /jsps/showResult.jsp
>   /jsps/inputPage.jsp
>   /jsps/successPage
>  
> 
>
> *index.jsp:*
> 
>  2
> 
>
> In my index.jsp, i am calling action to display showResult.jsp page. But
> dont know why it is displaying inputPage.jsp. I also put a breakpoint in my
> Action class and start the application in debug mode, but the execute method
> did not called.
> Please tell me whats happening? If you need more information please tell me
>
>   On Thu, Dec 11, 2008 at 4:04 AM, Andy Sykes  wrote:
>
>> Faraz,
>>
>> I think at this point some code would help. Could you post your
>> struts.xml, and the action?
>>
>> Andy.
>>
>> On 10 Dec 2008, at 17:16, Faraz Ali wrote:
>>
>>  Yes Andy, you are right. I added the , but why it
>>> is
>>> executing automatically. It is executed automatically when i start my
>>> application.
>>>
>>> On Wed, Dec 10, 2008 at 6:19 PM, Andy Sykes  wrote:
>>>
>>>  Faraz,

 When using validation, the input result tells Struts where to
 dispatch/redirect to if there's a validation error. When you submit the
 form, Struts checks the fields against the validation XML - if there's
 an
 error, it adds FieldError objects to the FieldErrors object on the value
 stack, and dispatches to the JSP (or other resource) defined in the
 input
 result element. This is nearly always the JSP containing the form you
 submitted from.

 You have to have a  because Struts has to know
 where
 to redirect in the event of a validation error.

 Not sure what you mean by the last bit of your question..

 Andy.



 On 10 Dec 2008, at 05:56, Faraz Ali wrote:

 13:45:18,390 ERROR [ActionComponent] Could not execute action:

> /web/MyAction
> No result defined for action com.web.actions.MyAction and result input
> -
> action - file:/C:/
> jboss-4.2.3.GA/server/default/tmp/deploy/tmp35854MyWeb-exp.war/WEB-
> <
> http://jboss-4.2.3.ga/server/default/tmp/deploy/tmp35854MyWeb-exp.war/WEB->
>
> INF/classes/struts.xml:12:69
>
> 1. I have a simple Action class MyAction
> 2. A corresponding MyAction-validation.xml present in same location as
> Action class
> 3.  is included in jsp
> 4. No  is present
>
> My Question is why do we need this input element? Because i want to
> control
> it my way. And if i add this input element, its opening the jsp page at
> the
> start of the application. Can anybody help me how to do validation
> properly
> in struts2 application?
>
> --
> Best Regards,
> Faraz Ali
>
>

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



>>>
>>> --
>>> Best Regards,
>>> Faraz Ali
>>>
>>
>>
>> -
>> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
>> For additional commands, e-mail: user-h...@struts.apache.org
>>
>>
>
>
> --
> Best Regards,
> Faraz Ali
>



-- 
Best Regards,
Faraz Ali


Re: Unexpected Exception caught setting 'uploadFileContentType'

2008-12-14 Thread Dave Newton
--- On Sun, 12/14/08, red phoenix  wrote:
> I have no  'uploadFileContentType'  and 'uploadFileFileName' in my 
> JSP, why raise 'uploadFileContentType' and 'uploadFileFileName' error? 

Because you have no 'uploadFileContentType' and 'uploadFileFileName' in your 
action.

> How to correct my above code?

Create 'uploadFileContentType' and 'uploadFileFileName' properties in your 
action.

http://struts.apache.org/2.0.14/docs/how-do-we-upload-files.html

Dave


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



Re: file name as null in model driven

2008-12-14 Thread srinivasa_v .
pls find the page that i have created and pls help me

On Fri, Dec 12, 2008 at 6:02 PM, Dave Newton  wrote:

> --- On Fri, 12/12/08, srinivasa_v wrote:
> >  > method="post" enctype="multipart/form-data" >
>
> Oh, did you mean "enctype"?
>
> >
> >
> >
> > in action class [...]
>
> It might be beneficial to include the portions of the form and model that
> include all aspects of the problem you're having.
>
> I've never used a file upload with modelDriven before, but I guess I'd
> assume it'd work.
>
> Dave
>
>
> -
> 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

Unexpected Exception caught setting 'uploadFileContentType'

2008-12-14 Thread red phoenix
I want to upload a file in struts2,my jsp file is follows:


 
 





my action is follows:
import java.io.File;
private File uploadFile;
public File getUploadFile(){
  return uploadFile;
 }
 public void setUploadFile(File uploadFile){
  this.uploadFile=uploadFile;
 }
public String upload() throws Exception{
request=ServletActionContext.getRequest();
return SUCCESS;
 }

when I run above code,it shows following error:
2008-12-14 23:45:45
com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
Fatal: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'uploadFileContentType' on 'class demo.TestAction: Error setting
expression 'uploadFileContentType' with value '[Ljava.lang.String;@80a22'

2008-12-14 23:45:45
com.opensymphony.xwork2.interceptor.ParametersInterceptor setParameters
Fatal: ParametersInterceptor - [setParameters]: Unexpected Exception caught
setting 'uploadFileFileName' on 'class demo.TestAction: Error setting
expression 'uploadFileFileName' with value '[Ljava.lang.String;@1d159e4

I have no  'uploadFileContentType'  and 'uploadFileFileName'   in my JSP,why
raise 'uploadFileContentType'  and 'uploadFileFileName'  error? How to
correct my above code?

Thanks in advance!


Re: [S2] ServletDispatcherResult (dispatcher) and forwarding to Actions

2008-12-14 Thread Dave Newton
You may be able to use the existing dynamic result configuration to implement 
this; see these two links:

http://cwiki.apache.org/WW/result-configuration.html
http://cwiki.apache.org/WW/parameters-in-configuration-results.html

Dave

--- On Sun, 12/14/08, Dirk Forchel wrote:
7:59 AM
> Has somebody any idea regarding the problem mentioned below.
> Every hint is appreciated.
> 
> 
> Dirk Forchel wrote:
> > 
> > I need your help. I wanna use the DispatcherResult
> (dispatcher) not as a
> > forward to a JSP (jsp/pages/test.jsp), but rather to
> forwarding to another
> > action request e.g. /test.action?code=1. Apparently
> there is no need for
> > doing that until you define something like the
> following in your
> > struts.xml
> > 
> >  class="com.foo.TestAction">
> > type="dispatcher">jsp/pages/test.jsp
> > 
> > 
> > I have written a "Request-History" where all
> HTTP-Requests are stored on a
> > stack, e.g. requests like
> "/test.action?code=1" or
> "/welcome.action" and
> > so on. If I wanna pull these requests from the stack
> and make a forward to
> > these action forwards (in Struts 1 I have used the
> ActionForward- or
> > ActionRedirect class for doing this). So how could I
> forward to actions
> > like this in Struts2? Where did I miss something?
> > I also implemented my own Result type (HistoryResult
> implements Result)
> > for pulling the stored HTTP-Requests from the
> history-stack and try to
> > forward and/or redirect to these URLs, but it
> doesn't work either. I can't
> > foward to something like /test.action but I can
> redirect to another
> > action. Where did I miss something. Here is the peace
> of code. 
> > 
> > if (redirect) 
> > { 
> >sendRedirect(response, location); 
> > } 
> > else 
> > { 
> >RequestDispatcher dispatcher =
> request.getRequestDispatcher(location); 
> >// if the view doesn't exist, let's do a
> 404 
> >if (dispatcher == null) { 
> >   response.sendError(404, "result '"
> + location + "' not found"); 
> >   return; 
> >} 
> >// If we're included, then include the view 
> >// Otherwise do forward 
> >// This allow the page to, for example, set content
> type 
> >if (!response.isCommitted() &&
> >
> (request.getAttribute("javax.servlet.include.servlet_path")
> == null)) { 
> >  
> request.setAttribute("struts.view_uri", location);
> 
> >  
> request.setAttribute("struts.request_uri",
> request.getRequestURI()); 
> >   dispatcher.forward(request, response); 
> >} else { 
> >   dispatcher.include(request, response); 
> >} 
> > } 
> > 
> > 
> > Here the Status after forward to this action:
> > 
> > HTTP Status 404 - //test.action
> > 
> > type Status report
> > 
> > message //test.action
> > 
> > description The requested resource (//test.action) is
> not available.
> > 
> > 
> > Even if I remove the first occurence of '/'
> and the location is
> > "test.action" rather than
> "/test.action", I got the same HTTP status
> > result. What's wrong with it?
> > 
> 
> -- 
> View this message in context:
> http://www.nabble.com/-S2--ServletDispatcherResult-%28dispatcher%29-and-forwarding-to-Actions-tp20950033p2188.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

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



Custm interceptor Problem

2008-12-14 Thread aum strut
Hi All,

I am developing custom inteceptor so that unauthorized user can not access
the resources using struts2. i am following the below mentioed approach

1) when user login process succeed i am putting user object in the session
2) For all other request when user try to hit the direct action URL like
http://kartavya-30a587:8080/BillSmart/Welcome.action
   i am checking(Using this interceptor) if the user object is there in the
session or not and it is working fine for me.

when the user first try to hit the direct URL he is getting redirected to
login page but even if i will provide the user credential it loged me to the
specified page like http://kartavya-30a587:8080/BillSmart/Welcome.action

but when i come back to login page withour logoff and then try to go
directly to a particular page it is not allowing me to do that even the user
object is there in the session.below is the code of my login action,login
interceptor and xml file.pleaes advise where i am doing wrong

3) When user provide valid credential he will be redirected to Welcome page
using Welcome action


Login Action
*

private* Map session;

*public* String execute() *throws* Exception{

*if*(getForm_pw().equals("228781")){

User user=*new* User();

user.setName("aum");

user.setAge("30");

 session.put(BillSmartConstants.*USER*,user);

session.put(BillSmartConstants.*USERNAME*, "aum");

*return* *SUCCESS*;

}



*LoginInterceptor*

public class AuthenticationInterceptor implements Interceptor {

 public void destroy() {
 }

 public void init() {
 }

 public String intercept( ActionInvocation actionInvocation ) throws
Exception {

  Map session = actionInvocation.getInvocationContext().getSession();

  purgeStaleTokens(session);

  User user = (User) session.get( BillSmartConstants.USER );

  if (user == null) {


  return Action.LOGIN;
  }


  else {

  Action action = ( Action ) actionInvocation.getAction();

  if (action instanceof UserAware) {
  ((UserAware)action).setUser(user);
  }

  System.out.println("Logged in: interceptor");
  return actionInvocation.invoke();
  }

 }

 private void purgeStaleTokens (Map session ){




  Object userToken = session.get( BillSmartConstants.USER );
  if ( !( userToken instanceof User ) ) session.remove
(BillSmartConstants.USER ) ;

 }

}

*user.xml*






   

   


   

  

  

  
   /index.jsp
   /chapterFour/Error.jsp
  



 
/Templates/User/Registration.jsp



my login.xml file is in another packae where i am not configured the
Authentication Inteceptor i just want that when ever any one hit directly
Welcome.action it must check if the user object is there in session if it is
there it must allow to go directly using this URL and if user obect is not
present it must ask the user to login first,but in case even the user object
is there in the session it is not allowing direct accessto the welcome page



Any help in this regard will be much appriciaed


Re: [S2] ServletDispatcherResult (dispatcher) and forwarding to Actions

2008-12-14 Thread Dirk Forchel

Has somebody any idea regarding the problem mentioned below. Every hint is
appreciated.


Dirk Forchel wrote:
> 
> I need your help. I wanna use the DispatcherResult (dispatcher) not as a
> forward to a JSP (jsp/pages/test.jsp), but rather to forwarding to another
> action request e.g. /test.action?code=1. Apparently there is no need for
> doing that until you define something like the following in your
> struts.xml
> 
> 
>jsp/pages/test.jsp
> 
> 
> I have written a "Request-History" where all HTTP-Requests are stored on a
> stack, e.g. requests like "/test.action?code=1" or "/welcome.action" and
> so on. If I wanna pull these requests from the stack and make a forward to
> these action forwards (in Struts 1 I have used the ActionForward- or
> ActionRedirect class for doing this). So how could I forward to actions
> like this in Struts2? Where did I miss something?
> I also implemented my own Result type (HistoryResult implements Result)
> for pulling the stored HTTP-Requests from the history-stack and try to
> forward and/or redirect to these URLs, but it doesn't work either. I can't
> foward to something like /test.action but I can redirect to another
> action. Where did I miss something. Here is the peace of code. 
> 
> if (redirect) 
> { 
>sendRedirect(response, location); 
> } 
> else 
> { 
>RequestDispatcher dispatcher = request.getRequestDispatcher(location); 
>// if the view doesn't exist, let's do a 404 
>if (dispatcher == null) { 
>   response.sendError(404, "result '" + location + "' not found"); 
>   return; 
>} 
>// If we're included, then include the view 
>// Otherwise do forward 
>// This allow the page to, for example, set content type 
>if (!response.isCommitted() &&
> (request.getAttribute("javax.servlet.include.servlet_path") == null)) { 
>   request.setAttribute("struts.view_uri", location); 
>   request.setAttribute("struts.request_uri", request.getRequestURI()); 
>   dispatcher.forward(request, response); 
>} else { 
>   dispatcher.include(request, response); 
>} 
> } 
> 
> 
> Here the Status after forward to this action:
> 
> HTTP Status 404 - //test.action
> 
> type Status report
> 
> message //test.action
> 
> description The requested resource (//test.action) is not available.
> 
> 
> Even if I remove the first occurence of '/' and the location is
> "test.action" rather than "/test.action", I got the same HTTP status
> result. What's wrong with it?
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--ServletDispatcherResult-%28dispatcher%29-and-forwarding-to-Actions-tp20950033p2188.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