Vinay_enjoy
asked on
Build web page dynamically
Hi,
In a web based application using jsp/htmls at front end, I need to build a page dynamically. Mean, I have to first ask few questions to the user and based on their answers only, I have to build and display the page accordingly.
Please help me know how can I do this in a web based application using java-j2ee technology.
Thanks,
Vinay.
email:vinay_aggarwal76@yah oo.com
In a web based application using jsp/htmls at front end, I need to build a page dynamically. Mean, I have to first ask few questions to the user and based on their answers only, I have to build and display the page accordingly.
Please help me know how can I do this in a web based application using java-j2ee technology.
Thanks,
Vinay.
email:vinay_aggarwal76@yah
I would agree mostly with Eternal_Student, I'd do something like:
<%
String param1 = ""+request.getParameter("p aram1");
if(param1 .equals("null")){
//give a form to fill in
%>
<form action="thispage.jsp" method="post">
<input type="text" name="param1">
</form>
<%
}
else{
//do somthing with the values
if(param1.equals("0")){
%>
<!-- do stuff that would happen if param1 was 0 -->
<% } //endif%>
<% }//endelse %>
<%
String param1 = ""+request.getParameter("p
if(param1 .equals("null")){
//give a form to fill in
%>
<form action="thispage.jsp" method="post">
<input type="text" name="param1">
</form>
<%
}
else{
//do somthing with the values
if(param1.equals("0")){
%>
<!-- do stuff that would happen if param1 was 0 -->
<% } //endif%>
<% }//endelse %>
ASKER
Thanks Guys. Let me elaboarte my requirement.
1. I have to display a table on the web page. But I have to ask the user first how many rows and columns he want. Based on his answer only, I would display thta many rows & cols.
2. Then I would ask the user what features he want. This will determine the name of the cols. Whatever features he chose from many check box options, those features will become the col heading.
3. In the final table, the left most col for Serial No will appear by default and it will be non-editable. The values will be 1 to n, populated automatically when the page/table gets displayed, depending on how many rows the user has chosen.
Appreciate further inputs on this.
Thanks Again,
Regards,
Vinay.
email:vinay_aggarwal76@yah oo.com
1. I have to display a table on the web page. But I have to ask the user first how many rows and columns he want. Based on his answer only, I would display thta many rows & cols.
2. Then I would ask the user what features he want. This will determine the name of the cols. Whatever features he chose from many check box options, those features will become the col heading.
3. In the final table, the left most col for Serial No will appear by default and it will be non-editable. The values will be 1 to n, populated automatically when the page/table gets displayed, depending on how many rows the user has chosen.
Appreciate further inputs on this.
Thanks Again,
Regards,
Vinay.
email:vinay_aggarwal76@yah
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot Lenehan !!!
This is very useful piece of code.
Cheers,
Vinay.
This is very useful piece of code.
Cheers,
Vinay.
That would be a simple option .. alternatively you could pass the values into the css styles inline. So you store the value in a variable, post that variable to the page that generates the layout/style etc etc and then extract the variable where needed.
Not sure entirely what you wish to achieve but that is a basic over-view.