473,581 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to load different content with the same page

kaleeswaran
132 New Member
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 6836
r035198x
13,262 MVP
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 New Member
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(respon se);
T.CreateHeader( response);
String Screen = (String)request .getParameter(" SCREENCODE");
System.out.prin tln("Screen1 "+Screen);
if (Screen==null)
Screen="";
if (Screen=="")
{
T.NoScreenCode( response);
out.println("Sc reen:"+Screen);
}
else if (Screen.equals( "FIRST"))
{
System.out.prin tln("Screen2 "+Screen);
T.FirstScreenCo de(response,req uest);
out.println("Sc reen");
}
T.EndHeader(res ponse);
%>
In Servlet File:

public TestJava(HttpSe rvletResponse response) throws ServletExceptio n, IOException
{
out =response.getWr iter();
System.out.prin t("123");

}
public void NoScreenCode(Ht tpServletRespon se response)
throws ServletExceptio n, IOException {
System.out.prin t("------------------------");
out.write("<for m method=Post target=index.js p>") ;
out.write("<Inp ut Type=Text Name=Text>");
out.write("<Inp ut Type=Text Name=Pass>");
out.write("<Inp ut Type=hidden Name=SCREENCODE value=FIRST >");
out.write("<Inp ut Type=Submit Value=submit Name=btn >");
out.write("</form>");

}

public void FirstScreenCode (HttpServletRes ponse response,HttpSe rvletRequest request)
throws ServletExceptio n, IOException
{
System.out.prin tln("********** ******* "+request.getPa rameter("SCREEN CODE"));
System.out.prin tln("FIRST");

//out.write("<for m method=Post target=index.js p>") ;
out.write("USer Name ");
//out.write("<H1> "+request.getPa rameter("Text") +"</h1>" );
//out.write("<Inp ut Type=Text Name=Pass>");
//out.write("<Inp ut Type=hidden Name=SCREENCODE value=SECOND >");
//out.write("<Inp ut Type=Submit Value=submit Name=btn >");
//out.write("</form>");

}
public void CreateHeader(Ht tpServletRespon se response)
throws ServletExceptio n, IOException {
PrintWriter out =response.getWr iter();
out.write("<htm l> <head> <title>KALEES PAGE</title> </head> <body>");
out.write("<for m method=Post target=index.js p>") ;
}

i don't know..is this is useful for reference.....
Nov 13 '07 #3
r035198x
13,262 MVP
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(respon se);
T.CreateHeader( response);
String Screen = (String)request .getParameter(" SCREENCODE");
System.out.prin tln("Screen1 "+Screen);
if (Screen==null)
Screen="";
if (Screen=="")
{
T.NoScreenCode( response);
out.println("Sc reen:"+Screen);
}
else if (Screen.equals( "FIRST"))
{
System.out.prin tln("Screen2 "+Screen);
T.FirstScreenCo de(response,req uest);
out.println("Sc reen");
}
T.EndHeader(res ponse);
%>
In Servlet File:

public TestJava(HttpSe rvletResponse response) throws ServletExceptio n, IOException
{
out =response.getWr iter();
System.out.prin t("123");

}
public void NoScreenCode(Ht tpServletRespon se response)
throws ServletExceptio n, IOException {
System.out.prin t("------------------------");
out.write("<for m method=Post target=index.js p>") ;
out.write("<Inp ut Type=Text Name=Text>");
out.write("<Inp ut Type=Text Name=Pass>");
out.write("<Inp ut Type=hidden Name=SCREENCODE value=FIRST >");
out.write("<Inp ut Type=Submit Value=submit Name=btn >");
out.write("</form>");

}

public void FirstScreenCode (HttpServletRes ponse response,HttpSe rvletRequest request)
throws ServletExceptio n, IOException
{
System.out.prin tln("********** ******* "+request.getPa rameter("SCREEN CODE"));
System.out.prin tln("FIRST");

//out.write("<for m method=Post target=index.js p>") ;
out.write("USer Name ");
//out.write("<H1> "+request.getPa rameter("Text") +"</h1>" );
//out.write("<Inp ut Type=Text Name=Pass>");
//out.write("<Inp ut Type=hidden Name=SCREENCODE value=SECOND >");
//out.write("<Inp ut Type=Submit Value=submit Name=btn >");
//out.write("</form>");

}
public void CreateHeader(Ht tpServletRespon se response)
throws ServletExceptio n, IOException {
PrintWriter out =response.getWr iter();
out.write("<htm l> <head> <title>KALEES PAGE</title> </head> <body>");
out.write("<for m method=Post target=index.js p>") ;
}

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 New Member
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 MVP
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 New Member
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 MVP
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
1958
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 like the following sample url "http://www.server.com/Index.htm?content.txt" After loading the index.htm a included html script should load the...
4
4065
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 subdir as .ascx files.I made OSearch application in IIS ,because i want all the pages in it with authentiacation.now these pages couldnt load the...
1
551
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 type name in the DLL. The permissions on the bin drectory look okay. In fact, the problem only occurs on a few machines. I have been unable to...
1
10781
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. Today, I wanted to access the home page of the application again with a browser. But instead of the proper page, I just got an ugly message: ...
6
3073
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 loaded into the treemenu div. What is the best way to achieve this? I got error where the treemenu didn't close/open on the treenode, as when I clicked...
1
1956
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 appreciated. Thanks.
6
4727
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
1120
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
4872
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 Session and data from database regarding to that tree node value. Will fetch the records and load that on content page on Content Page Load event. ...
3
6657
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 anchors have some CSS to make them look pretty. I'd like to be able to dynamically set the CSS for A1 when I navigate to C1 so it looks slightly different...
0
7788
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8137
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8163
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5355
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3799
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3813
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1397
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1127
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.