my Assignment is this : there is a index.jsp with header welcome.And a link "open".when someone click this "open" this must show HELLO in the same index.jsp. And this Hello must be from another jsp file
( simply, i want to embed hello.jsp into index.jsp when "open" is clicked ). how to do this.

please help me. i thank all of u in advance

Recommended Answers

All 4 Replies

We will help you if and only if you show some effort else do not expect too much from this forum.
So Show what have you coded so far ?

We will help you if and only if you show some effort else do not expect too much from this forum.
So Show what have you coded so far ?

i tried the include tag of JSP tag library. but its still static.i want a dynamic thing. like only after clicking the link it should show Hello in the Same index.jsp.

To understand the following suggestion or enhance it even you will need some knowledge of HTML forms. So here we go:-
In your index.jsp create an HTML form with an input field (it could be hiddent or a text field) named "hello" and another "Submit" button for that form. Also set the "action" field of that form to the same index.jsp.
Alternatively you could also simulate a HTTP GET request by using the anchor element (<a> tag). for example "http://...../sample.jsp?user=cdf" is equivalent to a form with an input element "user" being posted to file "sample.jsp"using the "HTTP GET" method.

Next in your JSP section check for the occurrence of the parameter named "hello", using request.getParameter("hello"); .
If you get any value for this other than a "null", that would mean you have been directed to this page, after you clicked the submit button on your form.
So in case you do not get the "null" just print "Hello" or any other text you wish using a normal "if" check.

To understand the following suggestion or enhance it even you will need some knowledge of HTML forms. So here we go:-
In your index.jsp create an HTML form with an input field (it could be hiddent or a text field) named "hello" and another "Submit" button for that form. Also set the "action" field of that form to the same index.jsp.
Alternatively you could also simulate a HTTP GET request by using the anchor element (<a> tag). for example "http://...../sample.jsp?user=cdf" is equivalent to a form with an input element "user" being posted to file "sample.jsp"using the "HTTP GET" method.

Next in your JSP section check for the occurrence of the parameter named "hello", using request.getParameter("hello"); .
If you get any value for this other than a "null", that would mean you have been directed to this page, after you clicked the submit button on your form.
So in case you do not get the "null" just print "Hello" or any other text you wish using a normal "if" check.

thank u very much for a valuable suggestion. i will try this and will trun back to u with the result.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.