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

Two actions in a single JSP

P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

I ham having login and register in a single jsp page. i can't use two actions in single jsp page please help me to solve my issue. and the main thing is it wants to display in right side.


I have developed but my login text field only coming in right side my register field it's not coming in right side please help me.




My register field is coming in left on the login field please solve my issue. No one is not there to guide me in my office please solve me. within a day i wants to solve my issue. please help me.

If iam using single form with action it is coming in right side but i can't bring two actions in sing jsp page in right side.


Thanks in advance.
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 5288
    
  10

P Arunkumar wrote:My register field is coming in left on the login field please solve my issue. No one is not there to guide me in my office please solve me. within a day i wants to solve my issue. please help me.

First of all: EaseUp (<-- click the link)

Table-based layouts are inefficient and outmoded; they're so 1990s. Please use CSS to style forms so that they are displayed where you want them on the page.


Junilu - [How to Ask Questions] [How to Answer Questions]
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

You have some html errors in there, "<<s:" on line 15/16 ?

Also your second table has no <tr><td>

If you want the forms aligned horizontally, create a wrapper table with two cells.
(If you want to stay with tables, css and divs are the better more modern way)

<table>
<tr><td>LOGIN Stuff</td><td>REGISTER Stuff</td></tr>
</table>

WP
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Thanks for reply.

I agree that we can use CSS instead of table format. but question is i wants to use two actions in single jsp page. please help me.
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Hi Arun,
One way out is to have a javascript method for the second action and use this javascript method to set the action explicitly . something like


Have Fun with Java
little,little.. little by little makes a lot..
P Arunkumar
Ranch Hand

Joined: Jan 05, 2012
Posts: 119
Hi

Thank You So Much.... I have completed my task. Its working perfectly. 2 forms 2 actions in a single page. I have used Servlet concept on this, but for time being i have completed in servlet but after completing in will post my code in struts.


Main.jsp



Login.java




Register.java



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two actions in a single JSP