Get printer url in jsp

hi
how to get the printer url in java/jsp?
any method to get the printer IP.

yes i worked out it in that way...
String url = request.getRequestURL().toString().replaceAll(request.getRequestURI(),"");Is any other good way to do it?
Edited by: jStanzilaous on May 5, 2008 4:11 AM

Similar Messages

  • How do I get the URL of a jsp page?

    I have a jsp page which has a link to a servlet page, in the servlet page, I want to get the URL of the jsp page.
    I tried to use request.getHeader("referer"), it seems like if it is a link in the jsp directly lead to the servlet, it works, but if the link calls a javascript function which opens up a window runing the servlet, it is not working. I have to do the second way, so it is not working by doing request.getHeader("referer")
    I tried to use javascript "location.href", I get the whole url by alerting the url in the jsp page:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal&bcd=ABC123&pnm=P1001830&prnm=1&psd=236863.0&ln=01&sln=NYPPA&stp=2.1&stt=A&_POSID=1F8464122ADAF4EEC9B1A94C286EB252
    then I pass this url when calling with my servlet, in the servlet page, when I do request.getParameter("url"), the url is actually cut off like this:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal
    anything after &pnm is cut off, anyone has any idea?
    Thanks in advance.

    Thank you.
    but how do I put encoding in the javascript code? do I need to decode in my servlet page?
    here is my code in the jsp page:
    linkset[3]+='<div class="menuitems">Email Diagnostics to AutoOne</div>'<%     
    function emailDiagnostics()
    win = window.open("/pos-webapp/serv/email_diagnostics?url=" + location.href + "&browser=" + navigator.appName, "emailDiagnostics",
    "width=350, height=140, resizable=no, scrollbars=no, toolbar=no, location=yes, directories=no, status=no, menubar=no, copyhistory=no, left=450, top=300");
    win.focus();
    }

  • How to get the URL parameter value when navigating from JSP Page to portal

    Hi All,
    I have web Dynpro application with one button, while clicking that button It will navigate to JSP page as external window. In the JSP page I have a input field and Button.
    In the JSP page input field I will enter some values and press submit button, it will navigate to Portal page by passing some URL parameter with values.
    Once user entering to portal by default WD page displayed, the same WD page I try to get the URL Parameter which I have passed from JSP page, but I am not able to get the URL parameter value.
    If same application running in without portal, I can able to get the URL parameter values. I am getting the URL parameter by interface view default inbound plug parameter.
    How do we resolve this problem?
    Regards,
    Boopathi M

    Hi
    Please try  these link might helpful for you
    1.[How to call WebDynPro application from JSP |/thread/452762 [original link is broken];
    2.[How to get the previous page url from abstract portal component? |/thread/1289256 [original link is broken];
    3.[how to launch and pass a parameter |/thread/5537 [original link is broken];
    Best Regards
    Satish Kumar

  • Getting page number while JSP printing- link rel="alternate" media="print"

    <link rel="alternate" media="print" href="reportprint.jsp"
    This i am using for printing report.jsp. report.jsp contains more than 2000 records. I need to have the page number to put the column header in each page.
    What is the possible way to get the page number in reportprint.jsp??

    Hi Raghuveer,
    I am getting the same error...
    were you able to resolve it??
    Part of log file says...
    [Jun 28, 2010 12:47:28 PM BST]:1277725648271:Thread[outboundThreadGroup3,5,outboundThreadGroup]:0:-1:stevux1213:10.145.81.43:-1:-1:STATEMENT:[fnd.wf.mailer.URLMIMETagListener]:oracle.apps.fnd.wf.mailer.URLMIMETagListener.tagFound(HTMLTagEvent) TAG {<META name="fwk-error" content="Error occured while processing the request">}
    [Jun 28, 2010 12:47:28 PM BST]:1277725648272:Thread[outboundThreadGroup3,5,outboundThreadGroup]:0:-1:stevux1213:10.145.81.43:-1:-1:STATEMENT:[fnd.wf.mailer.URLMIMETagListener]:fwk-error detected
    All,
    can you please help?
    Thanks,
    S

  • Get Gateway name / url via JSP

    Anyone say what is the method to get the Gateway name / url via JSP?
    Thanks
    Fausto

    Alex, in the normal case you have reason the client host is the gateway host.
    A simple code:
    <%
    InetAddress inet = InetAddress.getByName( request.getRemoteHost() );
    String gateway = inet.getHostName();
    String portal="http://" + gateway + "/portal/dt";
    gateway="https://" + gateway + "/";
    String url=request.getParameter("url");
    if ( url != null) {
    response.sendRedirect(gateway + url);;
    }else{
    responde.sendRedirect(gateway + portal);
    %>
    I put a jsp in the web container, I contact the jsp trough an url
    http://www.mydomain/portal/desktop/redirect.jsp without the method get for the url variable, if I call the jsp directly without gateway from my client the gateway variable is my dns hostname and the jsp cannot redirect my in the portal login page
    If I take the localhost, it works fine but if a particular case when the gateway and the platform are the same host.
    There is not a HTTP enviroment variable to get the gateway name or a simple java method to ask the correct host?
    Thank you again
    Fausto
    http://www.mydomain/portal/desktop/redirect.jsp
    i

  • How do I get the URL of a jsp page which calls a servlet?

    I have a jsp page which will lead to a servlet, I can get the URL of the servlet, but how do I get the URL of the jsp page which lead to the Servlet in the servlet?

    You could try doing:
    request.getHeader("Referer");

  • Print statement in JSP page after redirection

    Hi,
    I have written a JSP page and in that i am redirecting it to another page. Now after redirection i am printing a statement on the console. It is getting printed whereas when i am printing the same on the browser i am not able to print that. Please can any one tell me the difference between printing the same on the console and browser.
    My first JSP page(one.jsp)
    <%
         response.sendRedirect("two.jsp");
         out.println("After redirect");
         System.out.println("After out");
    %>
    My second JSP(two.jsp)
    <%
         out.println("In two.jsp");
    %>
    Thanks in advance
    regards
    Prashanth

    The sendRedirect sets a code in the HTTP response being sent to the client (I believe it is a 302 code but I am not sure off hand) and then proceeds to process the rest of the JSP on the server which is why the print statement shows up in the console.
    The out.println writes to the HTTP response output stream. The client gets the response and sees the HTTP Header code telling it to make a new request so it stops processing the response message and sends a new request message which is why the out.println message is not seen in the browser.

  • How to get the size of JSP html output?

    Hi,
    Is there a JSP method to get the size of JSP HTML output.
    e.g. I would like to print the size of the JSP e.g.
    Size of this page is <%=pageContext.getPageSize()%> Kb ???
    Any ideas? Thanks.
    George
    Edited by: googchro on Jan 5, 2010 4:45 PM

    Would you like to print "the size of this page is..." before or after you calculate the size of the page.
    Because adding that bit of text to the page will make the page bigger...
    Doing it in java, the best approach would probably to have a filter counting the number of bytes that gets sent to the writer/output stream.
    A client side tool measuring the amount of bytes received would probably be easier though.
    You can always look at the Content-length header sent with a response. Though you normally don't have access to that on the java/jsp side, as it is sent by the container.
    cheers,
    evnafets

  • Printing document in jsp

    Hello,
    I'm developing a web app which deals with invoices, delivery notes and that sort
    of things and i need to print the documents i create and show in the screen but
    just a part of the jsp page as i don't want the menu of the app to appear in the
    document to be printed. what can i do to print just a part of the jsp?
    so i have to send the information to pdf? what do u recommend?
    Thanks for your help

    You could implement a "printer friendly" version of your invoices which opens in a popup and then you can use window.print() to initiate the print dialog. This way you don't have to put any HTML controls on the page to be printed. You should advise users to turn off any headers in the browser which will also get printed, such as filename and pagenumber, this cannot be disabled automatically.

  • How to write printing function using JSP?

    dear all,
    i want to add a printing function in my project but i do not know how to do it? could anyone teach me how to do it?
    thanks
    eric

    salut eric,
    you can do it this way :
    1 - create a html link in your code to this javascript
    function : (I am using Struts, but you can write it in
    pure html
    <html:link href="#bodyStart"
    onclick="openWindowForPrinting()"
    titleKey="msg.status.print">      <bean:message
    key='app.print' />
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html:link>
    >
    >
    2 - here is the javascript function : it open a window
    with the "print.jsp" page.
    function openWindowForPrinting(){
    window.open('/your_project/pages/common/print.jsp','',
    'left=150, top=150 , status=no, directories=no,
    toolbar=no, menubar=yes, location=no, scrollbars=yes,
    resizable=yes, dependant=yes');
    3 : here is the print.jsp page : You have only to
    create a session variable called
    "currentBodyRelativeLocation", which content the
    relative URL to the page you want to print (for
    example, the boby of the current page).
    <%@ taglib uri='/WEB-INF/tlds/perso.tld'
    prefix='perso' %>
    <html>
    <head>
    <perso:csslink page='${cssRelativeLocation}' />
    </head>
    <body onload="var SymTmpWinOpen = window.open; window.open = SymWinOpen; printPage();; window.open = SymTmpWinOpen;">
    <body>
    <jsp:include page="${currentBodyRelativeLocation}"/>
    </body>
    <script language="JavaScript">
    <!--
    window.open = SymRealWinOpen;
    //-->
    </script>
    </html>
    <script language='javascript'>
    function printPage(){
    window.print();
    window.close();
    </script>
    hai,
    i'm not very understand how is your code work. when i write html code, do i need to mind about this code: "msg.status.print" ? what is this code mean?
    i have too much question on this thing. would you mind to be further explain to me? or is it any reference for me to refer? i'm really new to write printing function on JSP.
    i never write this function before. i'm feel so lost.....:(
    thanks again
    eric

  • Printing problem in jsp

    Hi...
    I have made an website by using jsp and servlets, the problem is that when click on the print option, to print that jsp page, the links get printed with that, and i want to avoid that link, please help me out from this problem,,thanks in advance...
    Bye n tc

    this is a html/css problem and not a java or jsp one.
    create a css file print.css for example and write the following to this file :
    a{
    display: none;
    }add this to the header of the JSPs you want to print :
    <link rel="stylesheet" media="print" href="/print.css" type="text/css" />

  • How to get Target URL

    Hallo,
    In my Dynpage portal application.I use 3 Jsp's.One of the Jsp having a Iframe element.This iframe source is an External HTTP address.In the source tag i have to supply the Results frame as some Iframe name and result-url as my 3rd jsp url,so that i can unpack the XML and process the data.
    All the 3 Jsp's are in /pagelet/ folder.Does anybody know how to get the url for the Jsp inside the pagelet folder.
    Further more pagelet folder is private folder,will it be a problem for the external website to post the result to this private /pagelet/3rd.jsp.
    Example src tag for Iframe
    http://demo.mygraphics.nl/nbgint/NBG_INT_main.asp?action=CHART&datas
    ource=NBGMV&product=INTERNET&size_x=300&size_y=300&result_frame=Results&
    result_url="Here i have to give my 3rd jsp url"&defa
    ult_centre_x=256000&default_centre_y=471000&default_width=0.5

    Hi gaurav,
    You are right,it is Jspdynpage.I have already read about the Urlgenerator that it can generate url's only for components and pages.So i have created 2 components in one PAR but havent tested yet.
    Anyway thanks for your reply.
    I have tested it and it works fine.Here is the code
          try {
              IUrlGeneratorService urlGen = (IUrlGeneratorService) PortalRuntime.getRuntimeResources().getService(IUrlGeneratorService.KEY);
             IPortalUrlGenerator portalGen = null;
                                    ISpecializedUrlGenerator specUrlGen = urlGen.getSpecializedUrlGenerator(IPortalUrlGenerator.KEY);
                                    if (specUrlGen instanceof IPortalUrlGenerator) {
                                         portalGen = (IPortalUrlGenerator) specUrlGen;
                                         // generate Component Url
                                         try {
                                              String url = null;
                                              url = portalGen.generatePortalComponentUrl(request,"NewUrlProj.NewUrlComp");
                                              HttpServletRequest srq = request.getServletRequest();
                                              String vorUrl = srq.getScheme()"://"srq.getServerName()":"srq.getServerPort();
                                            myBean.setUrl(vorUrl+url);
                                         } catch (NullPointerException e) {
                                              myBean.setErrorMsg("Unexpected Nullpointer. This should not happenend, but it did! Something must have gone wrong :-(");
           catch(Exception e){
              myBean.setErrorMsg(e.getLocalizedMessage());
    Message was edited by: Baskaran Senthivel

  • Get the url!help pl!

    Hi!
    Am doing a redirection to a page if the user gives the url directly in the browser.After redirecting I need to get the url which the user typed!Can anybody help pl!Thanks.

    Why don't you get the URL BEFORE the redirect?
    E.g.:
    Suppose the text field is named "newlocation":
    String newlocation = request.getParameter("newlocation");
    // save newlocation in a session or diskfile or something
    response.sendRedirect(newlocation);
    // Later on, back in your JSP code ...
    String newlocation = (read from session or diskfile or something)

  • Getting around URL aliasing or forwarding in Automator?

    Hi,
    I am new to automator but have a simple task that seems not straightforward to implement. I have a page on Google Sites (unfortunately not open to the public) and I upload and download ruby code to it. I'd like to automate downloading all the files that are have certain file extension and are linked from the main page. Those urls, when I copy them as links from the Safari browser, have a format like;
    http://sites.google.com/a/some_school.edu/my-cool-proj/Home/builder.c?attredirec ts=0
    My workflow is four safari actions;
    Get Specified URLs (the url is the top page of the google site for the project)
    Get Link URLs from Webpages
    Filter URLs
    Download URLs
    What I notice when I download those files manually from the Google Site page, using Safari, is that there is a second url that the link I started downloading gets forwarded to, apparently, and I can't seem to capture that manually to see what it is (it flashes across the browser's address bar and then dissappears pretty quickly.)
    Is there some simple way to follow these forwarded URLs, that is relatively foolproof, and that could be automated? I could take it on faith that the implementation of those forwarded links is not going to change, though that seems iffy. I could use or build some other site to post and pull code from, but that seems risky, and honestly the Automator script wouldn't save me more time than I would lose in such an effort.
    Any suggestions would be appreciated -
    C

    Hello Prashanth,
    It may not be as simple as adding an http header through the Oracle HTTP Server (OHS) in the stack. The web page is returned by both the Parallel Page Engine in OC4J_Portal and the Web Cache, not by the OHS. Since OHS doesn't play a role in the response, it is not possible to tag the headers.
    You could consider to install a reverse proxy server (e.g. Apache 2) in front of your web cache and add the header tag in this configuration. That should work.
    Thanks,
    EJ

  • Text overflown is not getting printed in the next page in ADOBE

    Hi Experts,
    I have a text field, where the users can enter the comments. In this text field if the user enters more than a page, a scroll bar appears in the print preview where the users can view the complete text what they have entered, but while printing the text which exceeds more than a page is not getting printed in the next page.
    I have set the subform properties as "Flowed" and the check box "Allow Page Break within content" is also been enabled, but still the extra contents is not getting printed in the next page.
    Please help me regarding this.
    Thanks & Regards,
    Karthik MD

    Hi Lohitha,
    Even "Expand to fit" is been enabled.
    Thanks & Regards,
    Karthik MD

Maybe you are looking for

  • Plugin 1.4.0 doesn't work w/ gcc 3 Mozilla

    I prefer to compile most apps on my desktop Linux machine. Using gcc 3 gives a notable speed improvement to Mozilla (0.9.9), but when I first tried it I was disappointed to find that it wasn't able to use Flash or Java plugins because of gcc 3's pecu

  • What would be a better choice between a MacBook Pro and a MacBook Air?

    I will be starting college next fall as a neuroscience major and I am torn between purchasing a MacBook Pro vs. a MacBook Air. Which would be a better choice considering I would be using it to take notes, creating documents, presentations etc.? I am

  • Movement type setting to control blocked, unrestricted or quality stock

    Hi All, I am trying to find out what exact setting within a movement type controls whether the material goes in to unrectricted, blocked or quality stock. For example 101 and 103. Movement type 101 receives the material in to unrestricted stock while

  • Itunes doen't want to play wma file already on computer

    I just got a mac and copies a folder from my PC to my mac, some of it contains MP3's which itunes recognises places in library and plays, but the wma file it won't do anything with, it wont import, cant drag and drop into itunes and wont play it, onl

  • Time Capsule download issues with Windows 7

    Hello together My problem is as follows: upload to Time Capsule with two PCs running on Windows 7 (both 32 and 64 bit) and a Mac Book Pro is working without any problems occuring. TC and the two PCs are in the same workgroup and PCs are connected via