473,426 Members | 1,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,426 software developers and data experts.

Need webservice to tell JSP To change page

Sl1ver
196 100+
Good bytonions

I have this code in my Registration.jsp page

Expand|Select|Wrap|Line Numbers
  1. <%
  2.                                 if (request.getParameter("txtName") != null){
  3.             if(service.getPort().register(
  4.                     request.getParameter("txtName"),
  5.                     request.getParameter("txtSurname"),
  6.                     request.getParameter("txtPassword"),
  7.                     request.getParameter("txtEmail"),
  8.                     request.getParameter("txtQuestion"),
  9.                     request.getParameter("txtAnswer"))){response.sendRedirect("index.jsp");}
  10.             }
  11.  
  12.             %>
  13.  
Expand|Select|Wrap|Line Numbers
  1. /**
  2.      * Web service operation
  3.      */
  4.     @WebMethod(operationName = "Register")
  5.     public boolean Register  (@WebParam(name = "name")
  6.     String name, @WebParam(name = "surname")
  7.     String surname, @WebParam(name = "pass")
  8.     String pass, @WebParam(name = "mail")
  9.     String mail, @WebParam(name = "question")
  10.     String question, @WebParam(name = "answer")
  11.     String answer) {
  12.  
  13.         boolean flag = false;
  14.         if(conn.connect())
  15.         {
  16.             flag = conn.Register(name, surname, pass, mail, question, answer);
  17.             conn.disconect();
  18.         }
  19.         return flag;
  20.     }
  21.  
Expand|Select|Wrap|Line Numbers
  1. // the dbconnection.java that executes the sql
  2. public boolean Register(String user, String surname,String pass, String mail, String question, String answer)
  3.     {
  4.         try
  5.         {
  6.             String sql = ("Insert into Users (usr__name, usr__surname, usr__pass, usr__mail, usr__question, usr__answer)"+
  7.                     "values('"+user+"','"+surname+"','"+pass+"','"+mail+"','"+question+"','"+answer+"')");
  8.             statement.executeQuery(sql);
  9.  
  10.         }catch(SQLException ex)
  11.         {
  12.             //log this to the file
  13.         }
  14.         return false;
  15.     }
  16.  
What i do is load registration.jsp, then the form posts the to the registration page again and just for testing purposes i just check if they filled out one field.

this is sent to the webservice that returns a boolean value

How do i make it just insert the data and then take me to the index.jsp again

Hope you guys can help. (this does work, it just takes me back to the registration page and i need, when i get a response back go to index.jsp)
Aug 19 '10 #1
0 1095

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Mad Scientist Jr | last post by:
I am getting an error in my code that references a textbox inside the current row of my datagrid, whenever I try changing the page (paging is enabled). This code doesn't even run unless a button in...
8
by: David Thielen | last post by:
Hi; ..NET 2.0 I have a situation where when the user selects an item in a drop down list, the code behind is called to update the values in another list on the page. This update can take 3 -...
0
by: joe | last post by:
how to change page-level charset to big5
3
by: UJ | last post by:
Is there a way to tell when a webservice is called whether it came in through HTTP or HTTPS ? TIA - Jeff.
1
by: jobs | last post by:
Is there a way or an attribute I can set so that the selected page number in paging is a different color or is underlined? perhaps it's my skin or css, but In my gridviews I can't tell what page we...
7
by: Mufasa | last post by:
I'm trying to know the page that I came from. If I use page.request.urlreferrer it seems to only be filled in once I am on one of the pages within my web site. I'd really like to know what page...
2
by: satnamsarai | last post by:
it is possible to change page orientation to landscape from asp.net page? I am using window.print() dialog to print a page and I would like that page to print automatically in landscape view.
6
by: lokeanwolf | last post by:
Hi. I'm trying to create a basic template for a page, so that I can have the headers and footers stay the same, and only change the center content. I've already figured out how to do the includes...
0
by: chaitanya02 | last post by:
Hello everybody, Could anyone update the code that calls webservice from a asp page.. Thanks, Tanya
2
by: jkdudhatra | last post by:
How To Change Page Orientation Of Default Printer In Visual Basic At Run Time ?
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.