How to use parameter of one web context in another one???

Hey guys,
I have a web context which is a servlet
The other web context is a jsp
I also have a login page
In the login page after clicking the submit button the
control is passed to the servlet.
The login page passes the username and password
to the servlet
i have used doGet() method.
I simply want to retrieve the parameter present in url of the servlet and use this in the jsp.
How is this possible??
To make things clearer , here are the three pages:
1> Login.html:<HTML>
{<HEAD>
<TITLE>
First Media - DashBoard
</TITLE>
</HEAD>
<BODY>
<FORM METHOD=GET
ACTION="http://localhost:8080/Dashboard/Dashboard">//url for servlet
<IMG SRC="C:\dashboard\Picture1.png"
ALT="Unable to display picture" ALIGN="LEFT" HEIGHT="150" WIDTH="150">
<H3>
<CENTER>
LOGIN SCREEN
</CENTER>
</H3>
<P></P><P></P>
<BR><BR><BR><BR><BR>
<P>
<H4>
<CENTER>First Media DashBoard Display</CENTER>
</H4>
</P>
<BR><BR>
<P>
<CENTER>
LOGIN ID ���
<INPUT TYPE="TEXT" NAME="userid">
</CENTER>
</P>
<BR><BR>
<P>
<CENTER>
PASSWORD ���
<INPUT TYPE="PASSWORD" NAME="userpass">
</CENTER>
</P>
<BR><BR>
<INPUT TYPE="SUBMIT" VALUE="SUBMIT">
</FORM>
</BODY>
</HTML>
Here's the servlet:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
public class Dashboard extends HttpServlet
     public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
          res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("<HTML>");
out.println("<HEAD><TITLE>FIRST MEDIA DASHBOARD</TITLE></HEAD>");
out.println("<FRAMESET ROWS=\"20%,80%\">");
out.println("<FRAME SRC=\"http://localhost:8080/Intro/Intro\">");//this is the url for the jsp
out.println("<FRAMESET COLS=\"20%,80%\">");
out.println("<FRAME SRC=\"c:/dashboard/MainNetwork.html\" NAME=\"mainframe\">");
out.println("<FRAME SRC=\"c:/dashboard/DisplayArea2.html\" NAME=\"displayframe\" SCROLLING=\"NO\">");
out.println("</FRAMESET>");
out.println("</FRAMESET>");
out.println("</HTML>");
Finally the jsp :
<HTML>
HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from tired old browsers
function multiLoad(doc1,doc2) {
parent.mainframe.location.href=doc1;
parent.displayframe.location.href=doc2;
// -->
</SCRIPT>
</HEAD>
<BODY>
<IMG SRC="C:\dashboard\Picture1.png"
ALIGN="LEFT" WIDTH="80" HEIGHT= "80">
<BR>
Network Log
���������
Service Levels
���������
<A HREF="# onClick=
"parent.location='http://localhost:8080/Dashboard/Login.html';
window.location='C:\dashboard\Login.html';">LogOut
</A>
<H3>
<%
if (request.getParameter("userid") == null)
     out.println("Welcome to dashboard");
else { 
out.println("Hello," + request.getParameter
("userid"));
} %></H3>//code to try to greet the user by name
</BODY>
</HTML>
I know this is a long one, but guys, please help!!!
Message was edited by:
alok1983
Message was edited by:
alok1983
Message was edited by:
alok1983
Message was edited by:
alok1983

If you re-post using the code tags to format the message some one may actually take the time to read it.

Similar Messages

  • How to use JSP in apache web server

    hi all,
    can anybody tell me how to use JSPs in Apache Web Server.
    Thanks
    sir

    You would need a servlet container to run Servlets and JSPs. And Apache's Tomcat is one such free container available. Download Tomcat from http://jakarta.apache.org and integrate with Apache WS
    HTH

  • [Forum FAQ] How to use parameter to control the Expand/Collapse drill-down options in SSRS report?

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

    In SQL Server Reporting Services (SSRS), drill-down is an action we can apply to any report item to hide and show other report items. They all are ways that we can organize and display data to help our users understand our report better. In this article,
    we are talking about how to use parameter to control the Expand/Collapse drill-down options in SSRS report.
    Consider that the report has a dataset (dsSales) with following fields: SalesTerritoryGroup, SalesTerritoryCountry, CalendarYear, SalesAmount.
    1. The report has the following group settings:
    Parent Group: SalesTerritoryGroup
     Child Group: SalesTerritoryCountry
      Child Group: CalendarYear
       Details: SalesAmount
    2. Add three parameters in the report:
    GroupExpand:
    Available Values: “Specify values”
    Label: Yes           Value: Yes
    Label: No            Value: No
    Default Values: “Specify values”
    Value: Yes
    CountryExpand:
    Available Values: “Specify values”
    Label: Yes           Value: =IIF(Parameters!GroupExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No","No","Yes")
    YearExpand:
    Available Values: “Specify values”
    Label: Yes          
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No",Nothing,"Yes")
    Label: No            Value: No
    Default Values: “Specify values”
    Value: =IIF(Parameters!GroupExpand.Value="No" or Parameters!CountryExpand.Value="No","No","Yes")
    3. Right click SalesTerritoryCountry icon in the Row Groups dialog box, select Group Properties.
    4. Click Visibility in the left pane. Select “Show or hide based on an expression” and type with following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", False, True)
    Select “Display can be toggled by this report item” option, and select “SalesTerritoryGroup” in the drop down list.
    5. Use the same method setting CalendarYear, (Details) drill-down with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", False, True)
    =IIF(Parameters!YearExpand.Value="Yes", False, True)
    6. Click SalesTerritoryGroup text box in the tablix. Select InitialToggleState property in the Properties dialog box, and type following expression:
    =IIF(Parameters!GroupExpand.Value="Yes", True, False)
    7. Use the same method setting SalesTerritoryCountry, CalendarYear text box with following expression:
    =IIF(Parameters!CountryExpand.Value="Yes", True, False)
    =IIF(Parameters!YearExpand.Value="Yes", True, False)
    After that, when we preview the report, we can use these three parameters to expand/collapse drill-down.
    Note:
    In our test, we may meet following issue. We can check the expression of InitialToggleState property to troubleshooting the issue.
    Applies to
    Reporting Services 2008
    Reporting Services 2008 R2
    Reporting Services 2012

  • Help me!    How to use it as a web service from third party application?

    After using JDeveloper to develop BSSV object e.g. JP550010, how to use it as a web service from third party application?
    TKS!

    Obviously the OP is working on a project for the Bead Society of Southeastern Virginia http://www.bssv.org. Oh, wait, maybe he's researching the Blueberry Shoestring Plant Virus http://abbreviations.yourdictionary.com/bssv
    :D
    John

  • How to use fp-2010 as web server

    how to use fp-2010 as web server
    mazhar 

    Hi Mazhar,
     It is fairly straighforward to set up front panels for your RealTime executable. This knowledgebase has the information on how to do this.
    Hope this helps!
    Warm regards,
    Karunya R
    National Instruments
    Applications Engineer

  • How to use Mac Mini Server as NAT with only one port??

    How to use Mac Mini Server as NAT with only one ethernet port??

    But why did apple sell me this server that does NAT with one port? I don't get it.

  • How to use addwatermarkfromfile on a web server

    how to use addwatermarkfromfile on a web server. Where do you put the js on a windows 2008 server, so that the URL can pick it up when a user opens a PDF.

    You don't.  JS files can exist in three places.
    1.  In the PDF file
    2.  In the User Profile
    3.  In the Application folders
    * Note while you can execute some browser based JS to the embedded viewer in a web browser all of the API calls are non-editing.

  • Pass data from one web application to another web application

    Hi,
    Please provide suggestion for following scenario:
    Scenario: Basically the aim is to transfer large amount of data from one application to another and display JSP of second application.
    User enteres data on a JSP of one web application. When he submits that data, another web application opens in new window and data from first application should be passed to this second web application. Another web application will display that data on its own JSP. User can perform whatever he wants on second application screen.
    Possible solutions:
    1) response.sendRedirect(): This makes GET request. But, there is large data to send. So, GET is not effective.
    2) forward(request, response): Can't use as I have to pass data to different application that is in another context.
    3) URLConnection: Here, I can make POST request and set attributes in HTTP request and make connection to another application. I can pass data using output stream. But, I can't display second application JSP to user even if I use input stream to read response. Because control will be ultimately in first application only.
    Is there any othe method to achieve this or any of the above options extendable?
    Please give your inputs.

    Hi,
    According to your post, my understanding is that you want to migrate list data from one web application to another.
    We can migrate list data programmatically, there are some articles for your reference.
    http://blogs.msdn.com/b/tejasr/archive/2007/11/12/code-snippet-copy-list-data-between-sites-programmatically.aspx
    http://www.fivenumber.com/copy-sharepoint-list-items-from-one-site-to-another-programmatically/
    http://geekswithblogs.net/AnneBougie/archive/2009/01/23/copy-a-sharepoint-list.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • Copy a publishing page from one Web Application to another

    can we copy a publishing page from one web application to another. 
    If we download a copy from pages library of one web application and upload it to another library of other Web application.
    Once uploaded it came up with an error "This page is not using a valid page layout.  To correct the problem, edit page settings and select a valid page layout.".

    It seems like the page layout is missing in target location. Check similar thread below to solve the issue
    http://social.msdn.microsoft.com/Forums/en-US/99c24657-0297-4a5c-8600-467bb6ea57d6/this-page-is-not-using-a-valid-page-layout-to-correct-the-problem-edit?forum=sharepointdevelopmentprevious
    shipoint.com/2014/03/28/fixing-this-page-is-not-using-a-valid-page-layout-to-correct-the-problem-edit-page-settings-and-select-a-valid-page-layout-error-in-sharepoint-2010/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • HT204053 how can I reset my apple ID for create another one?

    how can I reset my apple ID for create another one?

    So sorry; somehow I forgot to provide the link.   Here it is ...
    Frequently asked questions about Apple ID
    Again, my apologies.

  • How can I delete my apple id and create another one with the same email?

    How can I delete my apple id and create another one with the same email?

    So sorry; somehow I forgot to provide the link.   Here it is ...
    Frequently asked questions about Apple ID
    Again, my apologies.

  • How to cancle the previous apple ID and creat another one for the same ipad mini

    Please advise how to cancle the previous apple ID and creat another one for the same ipad mini.
    Thank you.

    You can log out of an account (you can't 'cancel' an account) by tapping on it in Settings > iTunes & App Store - any content that you downloaded with that account will remain tied to that account. You can then create a new account via the Create New Apple ID button on that screen. If you don't want to give credit card details then follow the instructions on this page when creating the new account : http://support.apple.com/kb/HT2534

  • Place one IDML file inside another one.

    I want to place one or more IDML files into another single IDML "master" file.
    The master file is sort of a template for a site layout. The IDML files I need to embed represent single content boxes with specific layouts. The files for those content boxes are created outside of InDesign with some texts I get from a database.
    To retain those layouts I deemed it best to just place them into another document which is no problem with INDD but just with IDML.
    I managed to link multiple INDD files into the master file in InDesign itself, but can not figure out how to link IDML files. I also found that it is possible to link INDD files into IDML files, just not IDML into IDML.
    I need to be working with IDML as opposed to INDD because I have to be able to manipulate the files in an easy way outside of InDesign.
    Is there any way to link IDML files into other IDML files? Or if not, is there a possibility to convert my IDML files to INDD files without having to use a real instance of InDesign?
    Relevant Lines of code from the master IDML file taken from the Spread.xml file:
    <Link Self="u9f81" AssetURL="$ID/" AssetID="$ID/" LinkResourceURI="file:/path/to/subtemplates/box2.idml" LinkResourceFormat="$ID/InDesign Format Name" StoredState="Normal" LinkClassID="35906" LinkClientID="257" LinkResourceModified="false" LinkObjectModified="false" ShowInUI="true" CanEmbed="true" CanUnembed="true" CanPackage="true" ImportPolicy="NoAutoImport" ExportPolicy="NoAutoExport" LinkImportStamp="file 130505142560000000 1396736" LinkImportModificationTime="2014-07-22T16:50:56" LinkImportTime="2014-07-23T11:42:22" LinkResourceSize="0~155000" />
    If I leave this in and try to open the file in InDesign I get the error message that the linked file type is not supported
    <Link Self="u9f81" AssetURL="$ID/" AssetID="$ID/" LinkResourceURI="file:/path/to/subtemplates/box1.indd" LinkResourceFormat="$ID/InDesign Format Name" StoredState="Normal" LinkClassID="35906" LinkClientID="257" LinkResourceModified="false" LinkObjectModified="false" ShowInUI="true" CanEmbed="true" CanUnembed="true" CanPackage="true" ImportPolicy="NoAutoImport" ExportPolicy="NoAutoExport" LinkImportStamp="file 130505142560000000 1396736" LinkImportModificationTime="2014-07-22T16:50:56" LinkImportTime="2014-07-23T11:42:22" LinkResourceSize="0~155000" />
    If I put this in everything works fine.
    Notes: box1.indd and box2.idml are the exact same files, just saved differently by InDesign. The path to both files is a valid file system path and has full read/write access.

    Thank you for your reply. I already know that it is possible to edit IDML files, which is what I am already doing.
    What I am now looking for is a way to place one IDML file into another one like you are able to do with INDD files.
    Which file format should I use insted then? It must be editable outside of InDesign because I need to be able to change texts and stylings within the file.
    Laubender
    That possibly means you have to have InDesign Server to integrate in your workflow.
    That's the exact thing I am trying to avoid here.

  • Hi there is it possible to link anchor or any hyperlink from one widget card to another one?

    Hi there is it possible to link anchor or any hyperlink from one widget card to another one?
    I'm trying to make link from one page to another but it works for widget as general not specyfic card or button

    Re: How can I use an anchor to show a specific panel in a widget?
    Topic above is about my problem Sanjit. Is is possible to fix it or add some code to it?

  • Not able to execute one Java program from another one via. exec()

    Hi,
    I am new to this forum, so I might be asking a very trivial quetion.
    My program Ap1 is :
    class Ap1
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    p=rt.exec("javac,Pr.java");
    Runtime.getRuntime().exec("javac,Pr.java");
    When I run the above program, I get below error at the line 7(bold one):
    D:\batchwe>javac Ap1.java
    D:\batchwe>java Ap1
    Exception in thread "main" java.io.IOException: CreateProcess: javac,Pr.java err
    or=2
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
    at java.lang.ProcessImpl.start(ProcessImpl.java:30)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
    at java.lang.Runtime.exec(Runtime.java:591)
    at java.lang.Runtime.exec(Runtime.java:429)
    at java.lang.Runtime.exec(Runtime.java:326)
    at Ap1.main(Ap1.java:7)
    Path is set as below(which seems correct):
    D:\batchwe>path
    PATH=C:\Program Files\Java\jdk1.5.0_05\bin
    I am just wondering how to call one Java program from another one?!
    Please help.
    thanks
    Rashmi

    Hi diptaPB,
    Thanks for your suggestion.
    Here is how I tried it again, but not getting the desired output:
    Class Pr looks like below -->
    class Pr
    public static void main(String a[])
    System.out.println("hi from process");
    When I run 'Pr' from command prompt, i get the desired output:
    D:\batchwe>java Pr
    hi from process
    However, when I call 'Pr' from another program Ap2.java, it seems that it does not call 'Pr':
    class Ap2
    public static void main(String a[]) throws Exception
    Runtime rt=Runtime.getRuntime();
    Process p=null;
    String[] cmd=new String[2];
    cmd[0]="javac";
    cmd[1]="Pr.java";
    p=rt.exec("cmd");
    D:\batchwe>javac Ap2.java
    D:\batchwe>java Ap2
    ************* no output appears here***********************
    Looking forward for your help.
    regards
    Rashmi

Maybe you are looking for

  • How can I apply color to black and make it accurate?

    Hello, I have an illustration that is black, white, and shades of gray. I want to apply a color to the black, and have all the grays become tints of that color. I have tried different blending modes and I have tried monotones, but I don't think eithe

  • System time in the X-axis

    how to set system time in the X-axis for waveform chart or XY graph?

  • UTL_SMTP or UTL_MAIL

    Hi All, I need to send message from OA Framework through pl/sql procedure. Our database is 10g. What would you recommend to me UTL_SMTP or UTL_Mail. I have a code in which i able to send mail but how to send mail with attachment. If anyone can arrang

  • Losing documents, music etc, when installing a new mac os x software

    if i buy and install a mac software, say i buy and install the new os x mountain lion, will i lose everything on my mac that i have on it already once i install the new software or no?

  • Acrobat 9 not connecting to Thunderbird in Windows 8

    I have seen many posts from people where Acrobat will not send via Thunderbird.  This problem persists even while the email link works using other Windows apps and the mailto link on web pages. The solution is simple.  Open "Contol Panel" in Windows