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
7 6815
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.
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.....
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?
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...
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.
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?....
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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....
|
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...
|
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...
|
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
|
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,
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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...
|
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,...
|
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...
| |