Forum: JSP 29 Days Ago |
| Replies: 1 Views: 377 When the user logs in, do you put that user in the session?
String username;
String password;
// check the database to see if the user is valid.
if (yes) {
... |
Forum: JSP Oct 9th, 2009 |
| Replies: 6 Views: 598 Two questions?
- Did you start the server?
- What url are you using? |
Forum: JSP Sep 4th, 2009 |
| Replies: 10 Views: 1,314 When you go back to the DemoSession.jsp this code is executed:
String name = request.getParameter( "username" );
session.setAttribute( "theName", name );
But this: request.getParameter(... |
Forum: JSP Sep 4th, 2009 |
| Replies: 10 Views: 1,314 When the user logs in take the username and put it the session:
String username = request.getParameter("username");
String password = request.getParameter("password");
boolean b =... |
Forum: JSP Sep 3rd, 2009 |
| Replies: 10 Views: 1,314 You are not suppose to change the username in the session. You put it once when you log in. You don't set it every time you load a page.
Of course it is null every time you do this:
String... |
Forum: JSP Sep 3rd, 2009 |
| Replies: 10 Views: 1,314 If you put it in the session it shouldn't got away. You probably put it in the request, so better show some code. |
Forum: JSP Aug 31st, 2009 |
| Replies: 7 Views: 524 The first time the page loads this is null:
request.getParameter('searchPhrase')
So this is translated to:
window.open("searchRequestPopUp?searchId=null", . . .
So when the pop up opens... |
Forum: JSP Aug 31st, 2009 |
| Replies: 7 Views: 524 Post code of the page that opens the pop-up |
Forum: JSP Aug 31st, 2009 |
| Replies: 7 Views: 524 You need to submit the form that is at Page B to the Page A.
In details:
>The input field must be inside a form tag
>When you submit, the control will be transferred to the page that you define at... |
Forum: JSP Aug 26th, 2009 |
| Replies: 7 Views: 426 |
Forum: JSP Aug 26th, 2009 |
| Replies: 7 Views: 426 I have this in my code:
<a href="loginservlet?action=logout">Logout</a>
String action = request.getParameter("action");
And it prints correctly the value "logout". |
Forum: JSP Aug 25th, 2009 |
| Replies: 7 Views: 426 <a href="ProductController?linkValue=A" target="right">A</a>
And at the servlet use the "request.getParameter" |
Forum: JSP Aug 25th, 2009 |
| Replies: 5 Views: 457 Have you tried using 2 different forms?
<form name="form1" method="post" action="controller/servlet">
<input type="submit" name="event" value="Add">
</form>
<form name="form2"... |
Forum: JSP Aug 24th, 2009 |
| Replies: 5 Views: 457 Have you tried my suggestion? I believe that you can't get the value from a "button", but I might be wrong. |
Forum: JSP Aug 24th, 2009 |
| Replies: 4 Views: 450 Actually, I've never seen JSPs being mapped. From what I know you map servlets because, the servlet you define, is just the class name. But you cannot call class names, you need to map it to a url.... |
Forum: JSP Aug 23rd, 2009 |
| Replies: 4 Views: 450 There is no reason to do it for jsp. What are you trying to accomplish? |
Forum: JSP Aug 22nd, 2009 |
| Replies: 5 Views: 457 First of all we need to see the code at the servlet.
Second, you can have a hidden parameter in the jsp and the user clicks update to change its value:
<html><head>
<script... |
Forum: JSP Aug 11th, 2009 |
| Replies: 2 Views: 475 You can have a form at Main.jsp that submits to the return.jsp.
Create an input field or a hidden field at the main, and take its value at the return.jsp from the request:
Main
<form... |
Forum: JSP Jul 22nd, 2009 |
| Replies: 2 Views: 1,331 That you want in the way you want it cannot be done.
If you want to call a java method, after the page has rendered, by clicking a button you need to submit the form, to a servlet or jsp (preferably... |
Forum: JSP Jul 9th, 2009 |
| Replies: 12 Views: 643 First of all what do you mean by custom tag?
Second, I believe that they should behave the same, whether it is clicked with a mouse or by pressing <Enter>. If I am wrong someone please correct me.... |
Forum: JSP Jun 21st, 2009 |
| Replies: 4 Views: 704 I don't know if this the case, but you MUST first call:
rs.next()
to get the row from the ResultSet.
Meaning that when you do:
String Instructor = rst.getString("Instructor");
you probably get... |
Forum: JSP Jun 16th, 2009 |
| Replies: 11 Views: 721 |
Forum: JSP Jun 16th, 2009 |
| Replies: 11 Views: 721 If you don't get an answer soon don't start another thread asking the same thing. What did you expect? That the very first minute you posted everyone should give you the solution? Your impatience was... |
Forum: JSP Jun 9th, 2009 |
| Replies: 2 Views: 1,635 I took this example:
<select multiple="multiple">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="mercedes">Mercedes</option>
<option... |
Forum: JSP May 27th, 2009 |
| Replies: 10 Views: 1,989 We still don't know if the code before the call of that method is executed |
Forum: JSP May 27th, 2009 |
| Replies: 7 Views: 1,313 Maybe this will help:
http://struts.apache.org/2.0.11/docs/select.html
And a complete reference:
http://struts.apache.org/2.0.11/docs/tag-reference.html |
Forum: JSP May 27th, 2009 |
| Replies: 10 Views: 1,989 I don't believe that it will solve the problem. If this will execute correctly:
var z=productCode;
changeItemValueNew(form,z,y)
then this will also:
... |
Forum: JSP May 27th, 2009 |
| Replies: 10 Views: 1,989 First of all describe better what do you mean by this:
after giving that alert messsage it works otherwise not.
Also, firstly does the method being called correctly?
Try this to check the... |
Forum: JSP May 27th, 2009 |
| Replies: 10 Views: 1,989 What do you mean giving an alert. Post the code that works |
Forum: JSP May 26th, 2009 |
| Replies: 10 Views: 1,989 Try this:
changeValue('<%=i%>') |
Forum: JSP May 4th, 2009 |
| Replies: 9 Views: 1,854 If the column in the DB is declared to be type Date, the format is irrelevant. Because the column will contain Date not a Varchar. The data int the column doesn't have a format nor it needs one... |
Forum: JSP Apr 29th, 2009 |
| Replies: 9 Views: 1,854 First of all what type of argument does ps.setDate() have and what type are the to_date, from_date at your database?
Also if you need to convert a String to a Date try this:
String sDate =... |
Forum: JSP Apr 16th, 2009 |
| Replies: 7 Views: 638 can you do a System.out.println of the values:
id and fullName before you set them at the lifeinsured object? |
Forum: JSP Apr 16th, 2009 |
| Replies: 7 Views: 638 VALUES ('" + id + "','" + fullName
I don't see a missing quote. Are you sure this is the code you tried to run? |
Forum: JSP Apr 16th, 2009 |
| Replies: 7 Views: 638 The problem is where you create your query not where you read the value and call the set method:
Assuming this:
public void setId(String id) {
this.id = id;
}
>>> query = . . . . + "'"... |
Forum: JSP Jan 5th, 2009 |
| Replies: 9 Views: 2,330 One more thing that I forgot to add in the example.
If you want the HTML to create a link like this:
<a href="viewdata.jsp?value1=John">John</a>
The jsp should be:
<a... |
Forum: JSP Jan 5th, 2009 |
| Replies: 9 Views: 2,330 Also when you write something outside the <% %> it is displayed the way you write (HTML style).
So when you write this:
<a href="viewdata.jsp?value1="+sth+">"+ . . .
It will not concat. It... |
Forum: JSP Dec 8th, 2008 |
| Replies: 1 Views: 681 There is this tag:
<form action="">
File: <input type="file" />
</form>
Of course you can add more attributes. (name, size). |
Forum: JSP Sep 5th, 2008 |
| Replies: 4 Views: 3,187 <form action="">
...
<input type="text" name="text1" ......>
...
<input type="submit" value="Submit">
</form> |
Forum: JSP Sep 5th, 2008 |
| Replies: 4 Views: 3,187 Since you created it dynamically using java, then you can the values that you displayed and write a method that take these values and store them in the database.
If the values, are user inputs... |