Forum: JSP 8 Hours Ago |
| Replies: 5 Views: 65 Do you know jsp, or how to submit a request using form.
If yes then maybe you can have the button ("Add Cart") submit the form that has the items the customer has selected and after you retrieve... |
Forum: JSP 8 Hours Ago |
| Replies: 6 Views: 120 I usually don't work with frame and I don't have time to give it much thought right now.
But, have you tried submitting the form to the jsp that is the second frame?
I assume you have a page... |
Forum: JSP 10 Hours Ago |
| Replies: 5 Views: 65 Here is how:
1) Post to correct forum
2) Be more descriptive on your problem
3) Show some effort
If you are talking about a web application
4) Learn about request, session
5) Learn about... |
Forum: Java 11 Hours Ago |
| Replies: 3 Views: 397 Thanks for the idea. I have been wanting to create a game similar to this for fun, just to kill time, but couldn't get any smart ideas.
I will definitely build this and give it to my friends to play. |
Forum: Java 1 Day Ago |
| Replies: 1 Views: 61 What is the range of the random numbers? Because you can use the Math.random.
Check the API |
Forum: JSP 1 Day Ago |
| Replies: 6 Views: 120 Given this:
document.getElementbyName('myCombo').selectedValue = session.getAttribute("choice");
I simply advised you to study a little more before trying things that are out of your league.... |
Forum: JSP 1 Day Ago |
| Replies: 6 Views: 120 You cannot combine java and javascript that way. They are NOT the same:
document.getElementbyName('myCombo').selectedValue = '<%= session.getAttribute("choice") %>';
I see from your previous... |
Forum: JSP 1 Day Ago |
| Replies: 4 Views: 103 First of all request.setAttribute is void. It doesn't return a value to put it in a string.
Secondly:
You just said that it works. Then what is the problem? You cannot just go to a page,... |
Forum: JSP 1 Day Ago |
| Replies: 4 Views: 103 I can't see a problem with your page. Does the page submits? Does it go from page A to page B? Is the name of the Test.jsp correct and are the pages in the same folder?
Does onChange works? Should... |
Forum: Java 1 Day Ago |
| Replies: 2 Views: 79 At the validation I believe that the seconds should until 59. For the hours you 23, 59. Why not the same for seconds.
For the extract when you multiply and then do a mod, you will get 0.
123 *... |
Forum: JSP 1 Day Ago |
| Replies: 1 Views: 74 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: Java 1 Day Ago |
| Replies: 4 Views: 115 For the first problem the method would be:
public int calculateFactor(int a, int b) {
...
}
Inside you will do the checks described in the assignment. No explanation needed. The... |
Forum: Java 1 Day Ago |
| Replies: 4 Views: 115 For the second problem. You need the largest divisor? Then why start the loop from 1 and not from the number itself:
int n; // read from input using Scanner;
int maxDivisor = 1;
for (int... |
Forum: Java 1 Day Ago |
| Replies: 2 Views: 100 Well I would use a double matrix:
String [][] ARRAY = {
{"A", "B", ...},
{"B", "C", ...},
{"C", "D", ...},
....
} |
Forum: Java 1 Day Ago |
| Replies: 4 Views: 115 Your first code will not compile and it is not java (elif)
The second is totally inefficient and shows no thinking at all to the real problem |
Forum: JSP 1 Day Ago |
| Replies: 1 Views: 98 Why don't you use the post method? |
Forum: Java 2 Days Ago |
| Replies: 3 Views: 111 Given your description (the lack of description that is), you may use a System.out.println. |
Forum: JSP 3 Days Ago |
| Replies: 8 Views: 57,043 And what is the point of this post? This is a 4 year old thread which has been revived 1 year ago, with no useful information. Can someone please close this? |
Forum: Java 3 Days Ago |
| Replies: 2 Views: 139 public class testAssert {
public static void main(String[] args) {
int x = 5;
int y = 7;
boolean b = x!=y;
... |
Forum: JSP 3 Days Ago |
| Replies: 3 Views: 154 First of all when you have questions such as this, always search the API.
http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html#isNew()
... |
Forum: Java 3 Days Ago |
| Replies: 2 Views: 155 First of all you don't need to have 2 Scanner classes. One would be enough and you can call its methods as many times as you like in order to read as much input as you want.
And to VernonDozier,... |
Forum: Java 3 Days Ago |
| Replies: 21 Views: 387 Actually I understood that the objective was to monitor how many times a word appeared.
I would suggest sth like this:
String word;
Vector linesAppeared;
And the size of the vector would be... |
Forum: Java 4 Days Ago |
| Replies: 21 Views: 387 Vector vIf = new Vector();
....
// inside the while loop
if (line.equals("if")) {
Freq[1] = Freq[1] + 1;
vIf.add(lineCount);
} |
Forum: Java 4 Days Ago |
| Replies: 5 Views: 142 Both of your posts mean nothing to us:
Do you want us to search that chaos of yours in order to find the "first curly brace"?
or do you expect us to count 424 lines?
Post relevant code where... |
Forum: Java 4 Days Ago |
| Replies: 5 Views: 142 At what line you get the error and what does it say and at which class?
You probably haven't defined the actionPerformed method. |
Forum: Java 4 Days Ago |
| Replies: 19 Views: 372 That question has already been answered.
This thread has 19 posts and you went and read only the first and skipped the rest?
Like I said, if you read the rest of the thread you will realize... |
Forum: Java 4 Days Ago |
| Replies: 2 Views: 150 Don't loop like this:
for(int row=0; row<5; row++){
for(int col=0; col<3; col++){
Always like this:
for(int row=0; row<array.length; row++){
for(int col=0; col<array[row].length; col++){ |
Forum: Java 4 Days Ago |
| Replies: 19 Views: 372 You know very well that this is not the way to declare variables:
int firstnumber = 1,2,3,4,5,6,7,8,9,10,11,12,13;
int secondnumber = 1,2,3,4;
If you can't fix this, don't go any further.
... |
Forum: Java 4 Days Ago |
| Replies: 4 Views: 114 First it will calculate what is inside the parenthesis and return it. Then it will concatenate it with the rest:
System.out.println("(a)" + (1 + m[k]) );
// "(a)" + (1 + m[k]) --> "(a)" + (1+2)... |
Forum: Java 4 Days Ago |
| Replies: 4 Views: 114 Read the comments
int m [] = { 3, 2, 5, 2 };
int k = 0;
// k has value 0 so it returns 3. THEN k is increased because the ++ is after the variable
System.out.println("(a)" + m[ k++ ]; |
Forum: Java 4 Days Ago |
| Replies: 1 Views: 95 If you search the net with: "ActionListener" you will receive plenty of examples:
http://java.sun.com/docs/books/tutorial/uiswing/events/actionlistener.html
I took an example from that page and... |
Forum: Java 4 Days Ago |
| Replies: 1 Views: 87 That is done by DHTML. There are examples in the web. Just search using:
"html tabs menu" |
Forum: Java 4 Days Ago |
| Replies: 19 Views: 372 The ones between the "" are strings and they will be printed they way they are. Surely you have written the Hello World program:
System.out.println("Hello World");
System.out.println("Row... |
Forum: Java 5 Days Ago |
| Replies: 19 Views: 372 What do you mean by "X".
Maybe this:
number " + loops + " " + loops + " x " + num + " = " + result); |
Forum: Java 5 Days Ago |
| Replies: 2 Views: 117 Be more careful!!.
You missed the postcode. Count your arguments. |
Forum: Java 5 Days Ago |
| Replies: 21 Views: 387 java.util.Vector (http://java.sun.com/j2se/1.5.0/docs/api/java/util/Vector.html)
Vector<Integer> v = new Vector<Integer>();
v.add(1);
v.add(2);
v.add(3);
for (int i=0;i<v.size();i++) {
... |
Forum: Java 5 Days Ago |
| Replies: 21 Views: 387 int count = 0;
while(scanner.hasNext()) {
count++;
System.out.println("Line "+count+" is: "scanner.next());
}
You might need a Vector because you don't know how many lines are the... |
Forum: Java 5 Days Ago |
| Replies: 21 Views: 387 That is what I mean, but why don't you run it and see what happens. If you get correct results, it means that you understood correct. |
Forum: Java 5 Days Ago |
| Replies: 4 Views: 102 I think you need to remove the '0' from the first number:
personalList[0] = new Personal("Paul "," White ", 074078L , "51 Princes Street", "North Shields", "Tyne and Wear", 7852384379L); |
Forum: Java 5 Days Ago |
| Replies: 2 Views: 113 You just said the solution:
The method will have as argument a String.
If it is empty return a message (String)
else return null (a String can be null)
Use the trim and length method to do the... |