• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to enter action class without using action form

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

i am new to struts application . in my applicaton i got an error regading form bean returns null (Exception) while executing it. Actually what i did i enter user id & password in to login page it works fine & got the result .now i add one button named logout ,i got the problem here ,i wnt to login. i gave the userid & password i got the error .what i did in my application i used </html:fom> wher it call anothe action class

my jsp code
<html:submit value="login">Login</html:submit>
<html:submit>Logout</html:submit>
<html:form action="/Logout" method="post">

Strutsconfig.xml
<form-beans>
<form-bean name="LoginForm" type="com.app.orbit.Form.LoginForm"/>

</form-beans>
<action-mappings>
<action path="/Login"
type="com.app.orbit.Action.LoginAction"
name="LoginForm"
scope="request"
validate="true"
input="/pages/login.jsp">
<forward name="success" path="/pages/loginsuccess.jsp"/>
<forward name="fail" path="/pages/Loginfail.jsp"/>
</action>
<action path="/Logout"
name="LoginForm"
scope="request"
input="/pages/login.jsp"
type="com.app.orbit.Action.LogoutAction">
<forward name="success" path="/pages/login.jsp"/>

</action>
<action path="/Welcome" forward="/pages/login.jsp"/>
</action-mappings>

please help how i can enter to anothe action class

Thanks in advance
 
Sheriff
Posts: 9708
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Satya, welcome to javaranch.

When you use html:form tag, the target action class must have a form bean defined for it. I suppose you can skip this by using a normal form tag instead of html:form tag...
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or just use a link.
 
satya pradh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ankit ,yes you are right


i did not write form bean.so can you please tell me if i use general from to call action, i tried that one also but when i clicked on button no event hasnotbeen occured . can you plese guide me regarding this
<input type="submit" name="submit" value="logout" onclick=logout()>
function logout(){
<form action=/login.do>
}

Thanks in advance
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseCodeTags.

Am I understanding what you've written here correctly?Is that a form tag inside a JavaScript function?
 
Are we home yet? Wait, did we forget the tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic