However to access client-side data on the server, you have to send it from the client to the server,which can be done by using Ajex or jQuery.
int start = Integer.parseInt(request.getParameter("start"));
"start" is a parameter which should be received directly from HTML Page/JSP/HTML in servlet submitted just before.from where "start" is coming?
But here there is one problem the page that i'm passing is fix....
and actually i'm using ajax so main page is not Result.jsp....
so whenever i run my project it redirects my main page to result.jsp...is it possible to pass value in that way my main page remains as it is???
the path of ajax is like this:
admin calls search.jsp using ajax and search.jsp calls result.jsp using ajax
in short admin-->search-->result.
I'm not sure, if this is what you are looking for, but its just my thought on this problem.
Thank you for your reply Rajani...
can you please give me one sample code if possible....because i'm having a little bit trouble understanding your explanation.
Thanks in advance.
Joined: Dec 17, 2010
What I meant here is, suppose
// The code below is just a flow and requires some syntax fixes and optimization
What you are doing here is extracting the request parameter and assigning it as an attribute of a session. After this, if you do either redirect or forward, the value should be available, though out the session and if you keep it in application scope, it is accessible through the application . But if you chose to set this in request scope, and need to have the value available through out the navigation for HTTP redirects, you need to explicitly set to request scope before each invocation.
Though I have used jsp for page navigation control, it should have been implemented ideally by some sort of page controllers (servlets), but the idea remains the same.
Your suggestion was good i tried to use it but i'm not very familiar with custom tags so may be i'm doing some mistakes..
But as much as i learned about custom tags until now,i think even if i use your code my problem will remain as it is.Because here the problem is not about getting variable,it was already happening in my previous code...problem is that i'm using AJAX and therefore whenever i run my program after this line
the page is forwarded to the Result.jsp which is not i wanted because i'm trying to make next previous(pagination) functionality. And in that i'm using three AJAX operation. The page on which i want to do pagination is Result.jsp. And so instead of redirecting i need only variable on my Result.jsp page(without loosing my search result).
I know its complicated for me and for you guys to understand but i'm really stuck in this from a very long time please help....
anyone who knows AJAX as well as j2EE can help me.....
Thanks in advance.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com