Is there a way to set "action" in a WebForm object. I saw that
there is a getAction method but i need to change the action value of a form because of some javascript usage inside the form.
Thanks
Ozgur
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just did as you said,but the result was not what I hava expected,can you tell me why?
(actually,I want to change the action of myform,
then submit it,but after i had changed the action,the form's action changed,the request I got did not change,why?)
thanks
below is my code:
String newAction = "j_task_deny.jsp";
myform.getScriptableObject().setAction(newAction);
System.out.println(forms[0].getAction());
//now the result is j_task_deny.jsp
request = myform.getRequest();
System.out.println(request.getURL());
//now the result is http://localhost:8880/j_task_apply.jsp
System.out.println(myform.getAction());
//now the result is still j_task_deny.jsp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
String newAction = "j_task_deny.jsp";
myform.getScriptableObject().setAction(newAction);
System.out.println(myform.getAction());
//now the result is j_task_deny.jsp
request = myform.getRequest();
System.out.println(request.getURL());
//now the result is http://localhost:8880/j_task_apply.jsp,is not http://localhost:8880/j_task_deny.jsp
System.out.println(myform.getAction());
//now the result is still j_task_deny.jsp
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
Is there a way to set "action" in a WebForm object. I saw that
there is a getAction method but i need to change the action value of a form because of some javascript usage inside the form.
Thanks
Ozgur
form.getScriptableObject().setAction( new action )
hi,russgold
I just did as you said,but the result was not what I hava expected,can you tell me why?
(actually,I want to change the action of myform,
then submit it,but after i had changed the action,the form's action changed,the request I got did not change,why?)
thanks
below is my code:
String newAction = "j_task_deny.jsp";
myform.getScriptableObject().setAction(newAction);
System.out.println(forms[0].getAction());
//now the result is j_task_deny.jsp
request = myform.getRequest();
System.out.println(request.getURL());
//now the result is http://localhost:8880/j_task_apply.jsp
System.out.println(myform.getAction());
//now the result is still j_task_deny.jsp
I made some change on the code just posted
String newAction = "j_task_deny.jsp";
myform.getScriptableObject().setAction(newAction);
System.out.println(myform.getAction());
//now the result is j_task_deny.jsp
request = myform.getRequest();
System.out.println(request.getURL());
//now the result is http://localhost:8880/j_task_apply.jsp,is not http://localhost:8880/j_task_deny.jsp
System.out.println(myform.getAction());
//now the result is still j_task_deny.jsp
... and in the Aug 5 build
I have tried it,it worked
Thanks russgold