• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

submit button is not working

 
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hiiiiiii Freinds......I am a newcomer in the field of JSPs and Servlets.I am developing a web application and having a problem in forwarding control from one page to another page
welcome page of my application is index.jsp which is divided into three frames one frame is reserved for taking user input details i.e. username and password.after clicking upon submit button control should go to loginhandler.jsp after that a page welcome.jsp should open with welcome, username printed over it.
But i have a problem, upon clicking the submit button nothing is happening.What is the problem behind?please help me!
I am attaching code snippets with message.
 
Rancher
Posts: 4804
7
Mac OS X VI Editor Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you placing the Submit button inside a HTML <form> set? With the proper Action and Method values?

I recommend using Firefox with HttpFox plugin, it really helps see what is going on, which method you are using, paramtees, etc.
 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You aren't attaching any thing.
 
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
Don't attach anything, use code tags, and include the relevant configs/code.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have written about attachments but havn't attached anything.oops
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
index.jsp


login.jsp


loginhandler.jsp
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
now plesse reply!
 
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
Can you see that the formatting didn't work? Please edit your message to properly indent your code and remove the color/size tags.

Your form doesn't have an "action" attribute. (Or a closing form tag.)
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing to do with JSP -- moved to the HTML forum.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thank you for suggestions freinds!
i have edited the code for loginhandler.jsp,i application is in development mode and i am checking database connectivity at primary level....i want to knowthings like database beans are required at this level or not?
submit button is working now but even after entering the correct login details loginfailed.html page is openning!
formatted codes are given below

login.jsp

loginhandler.jsp

welcome.jsp




loginfailed.html




 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really not indent your code?
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sir,i am unable to understand how code would ne indented at javaranch?please tell clearly?
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use code tags and indented code and the indentation will be preserved.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but i have used them........i am really confused how to indent them further.
 
Bear Bibeault
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adding code tags after you've lost the formatting won't help. If you use code tags and put formatted code between them, the formatting will be preserved.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
please don't keep aside my queries and questions.i am looking for someone who can resolve them out after looking up the code thoroughly as i am not able to understand how indentation would be done?reply please?
 
Marshal
Posts: 28296
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's hardly surprising that things don't work. You have scriptlets in your JSP -- that's a bad thing. Not only that but you have your JDBC connection hard-coded in those scriptlets -- that's not a very good idea. Not only that but you are trying to use the JDBC-ODBC bridge and there's a good chance you haven't configured an ODBC data source on the server where the JSPs are running.

Anyway it might well be that one of your JSPs is throwing an exception. Have a look in the server logs to see if that's the case.
 
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

Ankit Tripathi wrote:please don't keep aside my queries and questions.i am looking for someone who can resolve them out after looking up the code thoroughly as i am not able to understand how indentation would be done?reply please?


The thing is that unindented code is unnecessarily difficult to read: you're a *lot* more likely if you put the effort in to make things as easy as possible to help you.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have separated the business logic and view.but this time i am getting a new error-
/loginhandler.jsp(4): class 'com.mycompany.login.Login' could not be loaded
probably occurred due to an error in /loginhandler.jsp line 4:
<jsp:useBean id="idHandler" class="com.mycompany.login.Login" scope="request" />

i am using weblogic 8.1 and oracle database server.codes for JSPs and bean class are given below-

login.jsp

loginhandler.jsp

welcome.jsp

Login.java







 
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
Looks like a deployment issue, perhaps.

Seriously--indent your code. You're not likely to get much help if it's difficult to read.

Also, I'm not sure those sendRedirects will work since you'll have already written to the response.
 
Ankit Tripathi
Ranch Hand
Posts: 199
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
seriously i am trying to keep my code as clear as possible.
what is the meaning of first and last sentences?pease explain clearly?
 
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

Ankit Tripathi wrote:seriously i am trying to keep my code as clear as possible.


Then indent it. Indentation indicates structure. Structure is important. Code is needlessly difficult to read without structure.

what is the meaning of first and last sentences?pease explain clearly?


You can't send a redirect after you've already written to the response (like with HTML).
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

i used javascript to focus() on the required field and it is working with <input type="text" name=... onchange=...> and similarly with <html><form></form></html>

but it is focusing something else when I am using <html:form...> and <html:text...>

please help me on this.

Thanks in advance for any help.

Regards.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
arun saha,

Why did you hijack this old thread. Post your question in your own thread.

Eric
 
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
And make sure you post in the correct form if it's a Struts-specific question.
 
CLUCK LIKE A CHICKEN! Now look at this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic