File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Struts Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Struts Button" Watch "Struts Button" New topic
Author

Struts Button

Matt Hoffman
Ranch Hand

Joined: Jun 03, 2004
Posts: 83
I need to do a demo of a application that I started in Struts. All I want is a user to click a button and it takes them to another page. Can this be done without adding and Action code..

This is what I have thus far...
<a href="#"><html:button styleClass="formButton" value="Next" forward="caseDetails"/></a>

How can I get this to work?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

If you don't want Struts semantics to your button, why use a Struts tag at all? Why not use a plain and simple HTML <button> tag?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Nitin Singh
Greenhorn

Joined: Oct 14, 2004
Posts: 24
You can try this.
1. Add this entry in yr struts-config.xml file's action-mappings section
<action path="/welcome" forward="/YourTargetPage.jsp"/>
2. Add a button as follows in yr page
<html:form action="/welcome">
<html:submit value="TakeMe"/>
</html:form>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

Nitin,

JavaRanch is a community of people from all over the world, many of who are not native English speakers. While using abbreviations like "yr" instead of spelling out "your" is convenient when text messaging your friends on a cell phone or in a chat room, it presents an extra challenge to those that are already struggling with English. Additionally, such shortcuts may confound automated translation tools that patrons of the Ranch may be making use of.

I would like to ask for your help in making the content of JavaRanch a little easier to read for everybody that visits here by not using such abbreviations.

thanks,
bear
JSP Forum Bartender
Nitin Singh
Greenhorn

Joined: Oct 14, 2004
Posts: 24
Bear,
Thanks for pointing it out. I will take care of it in my future posts.

-Nitin
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

We'd all appreciate that Nitin. Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Button