473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to load different content with the same page

kaleeswaran
132 100+
Hi!
i am trying to display different content with the same page.how to do that?...
my idea is the page is static but the content will be displayed on the page dynamically change when the user click the submit button...
give me some idea.....
thank you,
kaleeswaran
Nov 13 '07 #1
7 6815
r035198x
13,262 8TB
Hi!
i am trying to display different content with the same page.how to do that?...
my idea is the page is static but the content will be displayed on the page dynamically change when the user click the submit button...
give me some idea.....
thank you,
kaleeswaran
I suppose these are web pages you are talking about?
If you are using JSPs then this can stay in this forum, otherwise it does not belong in the Java forum. What content do you want to change on the page and where is this "dynamic" content coming from.
Nov 13 '07 #2
kaleeswaran
132 100+
Thank you for your reply....
ya for example suppose the user enter the user name password and then the page should not move to another screen.now i am trying in struts..
i did some sample code...the code look like this...
this is JSP PAGE::
<%@ page import="TestApp.TestJava" %>
<%
TestJava T= new TestJava(response);
T.CreateHeader(response);
String Screen = (String)request.getParameter("SCREENCODE");
System.out.println("Screen1 "+Screen);
if (Screen==null)
Screen="";
if (Screen=="")
{
T.NoScreenCode(response);
out.println("Screen:"+Screen);
}
else if (Screen.equals("FIRST"))
{
System.out.println("Screen2 "+Screen);
T.FirstScreenCode(response,request);
out.println("Screen");
}
T.EndHeader(response);
%>
In Servlet File:

public TestJava(HttpServletResponse response) throws ServletException, IOException
{
out =response.getWriter();
System.out.print("123");

}
public void NoScreenCode(HttpServletResponse response)
throws ServletException, IOException {
System.out.print("------------------------");
out.write("<form method=Post target=index.jsp>") ;
out.write("<Input Type=Text Name=Text>");
out.write("<Input Type=Text Name=Pass>");
out.write("<Input Type=hidden Name=SCREENCODE value=FIRST >");
out.write("<Input Type=Submit Value=submit Name=btn >");
out.write("</form>");

}

public void FirstScreenCode(HttpServletResponse response,HttpServletRequest request)
throws ServletException, IOException
{
System.out.println("***************** "+request.getParameter("SCREENCODE"));
System.out.println("FIRST");

//out.write("<form method=Post target=index.jsp>") ;
out.write("USer Name ");
//out.write("<H1>"+request.getParameter("Text")+"</h1>" );
//out.write("<Input Type=Text Name=Pass>");
//out.write("<Input Type=hidden Name=SCREENCODE value=SECOND >");
//out.write("<Input Type=Submit Value=submit Name=btn >");
//out.write("</form>");

}
public void CreateHeader(HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out =response.getWriter();
out.write("<html> <head> <title>KALEES PAGE</title> </head> <body>");
out.write("<form method=Post target=index.jsp>") ;
}

i don't know..is this is useful for reference.....
Nov 13 '07 #3
r035198x
13,262 8TB
Thank you for your reply....
ya for example suppose the user enter the user name password and then the page should not move to another screen.now i am trying in struts..
i did some sample code...the code look like this...
this is JSP PAGE::
<%@ page import="TestApp.TestJava" %>
<%
TestJava T= new TestJava(response);
T.CreateHeader(response);
String Screen = (String)request.getParameter("SCREENCODE");
System.out.println("Screen1 "+Screen);
if (Screen==null)
Screen="";
if (Screen=="")
{
T.NoScreenCode(response);
out.println("Screen:"+Screen);
}
else if (Screen.equals("FIRST"))
{
System.out.println("Screen2 "+Screen);
T.FirstScreenCode(response,request);
out.println("Screen");
}
T.EndHeader(response);
%>
In Servlet File:

public TestJava(HttpServletResponse response) throws ServletException, IOException
{
out =response.getWriter();
System.out.print("123");

}
public void NoScreenCode(HttpServletResponse response)
throws ServletException, IOException {
System.out.print("------------------------");
out.write("<form method=Post target=index.jsp>") ;
out.write("<Input Type=Text Name=Text>");
out.write("<Input Type=Text Name=Pass>");
out.write("<Input Type=hidden Name=SCREENCODE value=FIRST >");
out.write("<Input Type=Submit Value=submit Name=btn >");
out.write("</form>");

}

public void FirstScreenCode(HttpServletResponse response,HttpServletRequest request)
throws ServletException, IOException
{
System.out.println("***************** "+request.getParameter("SCREENCODE"));
System.out.println("FIRST");

//out.write("<form method=Post target=index.jsp>") ;
out.write("USer Name ");
//out.write("<H1>"+request.getParameter("Text")+"</h1>" );
//out.write("<Input Type=Text Name=Pass>");
//out.write("<Input Type=hidden Name=SCREENCODE value=SECOND >");
//out.write("<Input Type=Submit Value=submit Name=btn >");
//out.write("</form>");

}
public void CreateHeader(HttpServletResponse response)
throws ServletException, IOException {
PrintWriter out =response.getWriter();
out.write("<html> <head> <title>KALEES PAGE</title> </head> <body>");
out.write("<form method=Post target=index.jsp>") ;
}

i don't know..is this is useful for reference.....
So what do you want to happen when the user has entered the username and password?
Nov 13 '07 #4
kaleeswaran
132 100+
i like to display after the user enter the details and the next further information like a user informations on the same page...i want that the jsp page is remains constant but the content should change as user needs...
Nov 13 '07 #5
r035198x
13,262 8TB
i like to display after the user enter the details and the next further information like a user informations on the same page...i want that the jsp page is remains constant but the content should change as user needs...
That is not how such systems are usually designed.
Don't try to display everything on one page. It makes the whole thing cumbersome and impossible to maintain. A log in screen should not try to do more than providing functionality for a user to log in.
Nov 13 '07 #6
kaleeswaran
132 100+
okay thank you,
but i have more jsp page's.i am passing the value throw URL so i should minimize access time right?..i heard that we are passing the value through url accessing time will increase..that's why i am tried that....\
can u give some alternative solution?....
Nov 13 '07 #7
r035198x
13,262 8TB
okay thank you,
but i have more jsp page's.i am passing the value throw URL so i should minimize access time right?..i heard that we are passing the value through url accessing time will increase..that's why i am tried that....\
can u give some alternative solution?....

Put the values on a form and submit the form instead.
Nov 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Bosch News | last post by:
Hello, we are looking for a way to load in an existing html-file different txtfiles, which includes html-commands. Example(Not a real server): We want to load a layout.htm with an parameter...
4
by: Bogosian | last post by:
I am working on an asp.net project.There is a subdir called OSearch,with a few aspx pages in it which as all other pages on the website use some controls.These controls are stored in a another...
1
by: Chriss | last post by:
I receive "could not load type" error message when trying to load aspx page. The DLL is built and is located in the correct bin directory. The type name in the "inherits" attribute matches the...
1
by: urs | last post by:
Two days ago, I built an ASP.NET 2.0 application and published it on a shared IIS 6 Web server. After publishing, and during the whole day, it worked fine. The server remained untouched since....
6
by: acord | last post by:
Hi, In a html page, I don't know how to load in a php page from javascript. I've already defined a <div id="treemenu"> in the html page. The executed content from the php script is supposed...
1
by: ckarbass | last post by:
I'd like for the file download dialog to be launched upon page load. The workflow or behavior is exactly the same as sourceforge's. I've searched on google to no avail. Any help would be...
6
by: ipy2006 | last post by:
Other than the JavaScript of timing and rotating images every few seconds or minutes, is there a way to uniquely load a different picture every time a browser open a page? Thanks, yip
3
by: Kojikabutosv | last post by:
Hi everybody, i have a master page and with tree buttons, how configure the buttons to load pages dinamically in wichone pages. Regards,
1
by: hemantkamb | last post by:
Hi…. I have created one website with Master and content page . I have taken TreeView Control on master page. And I wants that when I click to tree node the value of tree node is added to...
3
by: Queez | last post by:
Very quick question. I have a master page (M1) and three content pages (C1, C2, C3). In M1, there's a list of three anchors (A1, A2, A3) which point towards the three content pages. The...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.