• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query string

 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I am using gethod getParameter() for getting parameters from query string, but I think this method is not fetching parameters in my code. getParameter() should return null in first request and value of counter i.e. 1 or -1 in second request, but it is returning null in second request also. Need help, please check my code.

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the HTML for the links look like when rendered at the browser? Are they properly formed on the browser page?

P.S. I hope that this is just test code. The time to be putting Java code in a JSP is long long passed!
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, links are formed properly and I am learning JSP. Its just a test code.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Astha Sharma wrote:yes, links are formed properly

Don't tell us. Show us.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
Astha Sharma wrote:yes, links are formed properly

Don't tell us. Show us.

I am not getting you. Please tell me how can i show you that?
This is the content of output page-
0 next previous
next and previous are links to the same jsp page with parameters counter=<%=count+1%> and counter=<%=count-1%> respectively.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what's beng sent to the browser? If so, your JSP isn't getting presley evaluated.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any mistake in my jsp code?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65129
92
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, you shouldn't be using Java code in a JSP anymore. That's a practice that was discredited 10 years ago. 10 years!

But if the JSP is not being evaluated its more likely a configuration problem.
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok...thanks for the reply.
 
sagar kumar nerella
Greenhorn
Posts: 18
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think you should use the EL expression support .
instead of using counter=count+1 use ${count} +1

i think it solves your problem
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi sagar
thanks for the reply, but actually the mistake was in the link which i was using in this code :banghead:
now i got the mistake and am getting correct output :beerchug:
 
sagar kumar nerella
Greenhorn
Posts: 18
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Astha Sharma wrote:Hi sagar
thanks for the reply, but actually the mistake was in the link which i was using in this code :banghead:
now i got the mistake and am getting correct output :beerchug:


ok then can you show me how you solved the problem i.e what modification you did
 
Astha Sharma
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sagar kumar nerella wrote:ok then can you show me how you solved the problem i.e what modification you did

this is the modified code-

Previously I was using wrong url in anchor tag
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic