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

query string

 
Ranch Hand
Posts: 250
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes, links are formed properly and I am learning JSP. Its just a test code.
 
Bear Bibeault
Sheriff
Posts: 67746
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

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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there any mistake in my jsp code?
 
Bear Bibeault
Sheriff
Posts: 67746
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok...thanks for the reply.
 
Greenhorn
Posts: 18
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic