Servlet page conte

JSP:
<%@ page contentType="application/vnd.ms-excel" %>
how do i convert this to servlet ??

start here, your question is just too general, sorry
http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/JSPIntro.html#89916

Similar Messages

  • R/3 connection from servlet page

    Helllo,
    I have implemented a servlet page from SAP NetWever Developer Studio:
      1 - J2EE -> Web Module Project for the development
      2 - J2EE -> Enterprise Application Project (EAR) for the deploy
    Now I need to access to the R/3 system. It is possible connect to R/3 system from a servlet page? In the portal already exists a system connection created under the section "Syatem Administration -> System Configuration" but I'm trying to implement the connection unsuccessfully (following the Java code used into the servlet):
    String sapSystem = "MNT";
    IUserAccount uacc = UMFactory.getUserAccountFactory().getUserAccountByLogonId("Administrator");
    IUserAccount iuacc = UMFactory.getUserAccountFactory().getMutableUserAccount(uacc.getUniqueID());
    IUser user = iuacc.getAssignedUser();
    IConnection connection = null;
    // get the Connector Gateway Service
    IPortalComponentRequest req = (IPortalComponentRequest) request;           => HERE Casting error
    Object connectorservice = PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
    IConnectorGatewayService cgService = (IConnectorGatewayService) connectorservice;
    ConnectionProperties cp = new ConnectionProperties(user.getLocale(), user);
    connection = cgService.getConnection(sapSystem, req);
    String res = "", name = "", path = "";
    // Get the Interaction interface for executing the command
    IInteraction ix = connection.createInteractionEx();
    // Get interaction spec and set the name of the command to run
    IInteractionSpec ixspec = ix.getInteractionSpec();
    String functionName = "Z_R3_FUNCTION";
    // Put Function Name into interaction Properties.
    ixspec.setPropertyValue("Name", functionName);
    // return structure - parametro di export della funzione
    String function_out = "P_PAR";
    String function_in_value = "VALUE";
    RecordFactory rf = ix.getRecordFactory();
    MappedRecord input = rf.createMappedRecord("input");
    // put function input parameters
    input.put("P_KUNNR", function_in_value);
    MappedRecord output = (MappedRecord) ix.execute(ixspec, input);
    connection.close();
    Object result = output.get(function_out);
    Anybody knows how implement it?
    Thanks and best regards,
    Matteo.

    Hello Marcos,
    I have followed the example shown in your link, I have found all JAR file, the Java code has not error, I hace deployed my project, but the server returns the error:
    java.lang.ExceptionInInitializerError: JCO.classInitialize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjcorfc in java.library.path]. java.library.path [/opt/java1.4/jre/lib/IA64W:/opt/java1.4/jre/lib/IA64W/server:/opt/java1.4/jre/../lib/IA64W:/usr/sap/PCT/JC00/j2ee/os_libs::/usr/sap/PCT/JC00/j2ee/os_libs:/usr/sap/PCT/SYS/exe/run:/usr/sap/PCT/SYS/exe/run:/usr/sap/PCT/SYS/exe/run:/oracle/PCT/sapdata4/SP24/LOGS/J2EE/sapinst_exe.252.1243940833:/usr/lib:/usr/sap/PCT/JC00/j2ee/os_libs:/usr/sap/PCT/JC00/j2ee/os_libs:]
    I have notice that into the folder "C:\Program Files\SAP\JDT\eclipse\plugins\com.sap.mw.jco\lib" there is the file sapjcorfc.dll
    Do you know if I have to put JAR into a particular folder into my project, or I have to do some configuration on the server?
    Thanks and best regards,
    Matteo

  • How to use Oracle Procedures with Servlet page

    Hi all
    I'm working on Servlet pages and I need to insert and select some records from Oracle database but it has to be done by calling some already written Procedures. I've never really used them before so I'm little lost. I know where the queries are used it'll be Procedures but what is the syntax for it.Can anyone put me in right direction please.
    Thanks

    Just google it. You will find lots of examples. Here are some :
    [http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html|http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html]
    [http://onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html|http://onjava.com/pub/a/onjava/2003/08/13/stored_procedures.html]

  • Oracle XSQL Servlet Page Processor 0.9.9.1 (Technology Preview)

    I trying XSQL Servlet in oracle8.1.6,Java Web Server.
    When I access http://localhost:8080/xsql/index.html
    I am getting this error.
    "Oracle XSQL Servlet Page Processor 0.9.9.1 (Technology Preview)
    XSQL-013: XSQL Page URI is null or has an invalid format."
    Any suggestion....
    null

    JWS is not one of the supported Servlet Engines in 1.0.0.0 please see the release notes for supported engines (there are lots of them).
    The XSQL 1.0.1.0 release will support and
    additional set of engines that cause XSQL-013 errors becuase the return null for
    the Servlet API call:
    req.getRealPath(req.getServletPath());

  • Java Servlet page not opening error 404

    Hi!
    I am working with servlets. I compiled the java file and the class file is been moved to
    c:\javawebserver2.0\servlets, and the html files moved to public_html. Html files r opening
    the classpath is mapped to jsdk.jar i.e
    set CLASSPATH=c:\javawebserver2.0\lib\jsdk.jar
    Built-in samples r working without any problem
    when i try to run the servlet
    Page Not Found error 404 occuring
    Please do the favour for me
    thanks

    404 Not Found means you didn't deploy the app properly.
    I think deploying an app like this is a terrible idea. If you have more than one app deployed on a production web server/servlet engine, you wouldn't want to put them all in the same place. "public_html" and the generic "servlets" directory shouldn't be used as dumping grounds for all your apps.
    Learn how to deploy using a WAR file. It'll keep all your apps separate and their constitutive parts together.
    Why Java Web Server? I don't think anyone uses it seriously anymore. Tomcat is the reference implementation of the servlet/JSP specs. I'd download that and use it instead of JWS. JMO, of course.

  • Verification Of SQL destils on a servlet page

    Hi,
    I am just wondering if anyone can help me with my litle problem, I need to read avalue from a database and display it on the servlet page, but the name has to be verified, something like:
    SELECT acbalance FROM actable WHERE acname = user
    I am wondering if I could read thevariable "user" from the session and verify it that way?
    If so, how do I do this?
    Or does anyone else have a better idea how I can do this?
    Any help greatly appreciated,
    Aidan.

    More simply you can use a PreparedStatement: SELECT acbalance FROM actable WHERE acname = ?... then, at each call, just use pstatement.setString(1, user)

  • Restoring of HREF on same servlet page

    hi,
    i have a servlet page that generating number of hyperlink in form of menu. on clicking any HREF control goes to other page.
    till now everything is fine, but i want to display most recent used top 10 HREF on servlet page without affecting the functionality.
    Pls help me.

    How about counting the clicks in static variables?
    Let's assume this:
    interface HrfClicks{
           public static int HRF1_CLICKED = 0;
           public static int HRF2_CLICKED = 0;
    public class TestServlet extends HttpServlet {
             public void doGet(HttpServletRequest request, HttpServletResponse){
                        HrfClicks.HRF1_CLICKED++;
                       //display the top ten links....etc.
    }Is that what you want?
    regards....
    Message was edited by:
    n3bul4

  • Not able to go to servlet page..

    Hello everyone.
    I am a new bee. I was trying to write a very simple sevlet code which takes form data from 1 html page and displays the form field on another page.
    My code is something like this in MyEclipse.The Project name is ThreeServlets. The directory structure is
    In order to make directory structure clear I am adding some comments which will be after "//" mark.
    ThreeServlets // Project directory
    +src                                         // source diretory
    coreservlets //package coreservlets
    ThreeParams.java // servlet
    +JRE System Library[JRE] // library files
    +J2EE 1.4 Libraries               
    +Webroot                            // this contains metainf,webinf and ThreeParamsForm.xml                 
    META-INF
    WEB-INF // this contains lib and web.xml
    lib
    web.xml
    ThreeParamsForm.html
    These are the source code for the ThreeParams.java
    package coreservlets;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class ThreeParams extends HttpServlet {
    public void doGet(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    String title = "Reading Three Request Parameters";
    String docType =
    "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 " +
    "Transitional//EN\">\n";
    out.println(docType +
    "<HTML>\n" +
    "<HEAD><TITLE>" + title + "</TITLE></HEAD>\n" +
    "<BODY BGCOLOR=\"#FDF5E6\">\n" +
    "<H1 ALIGN=\"CENTER\">" + title + "</H1>\n" +
    "<UL>\n" +
    " <LI><B>param1</B>: "
    + request.getParameter("param1") + "\n" +
    " <LI><B>param2</B>: "
    + request.getParameter("param2") + "\n" +
    " <LI><B>param3</B>: "
    + request.getParameter("param3") + "\n" +
    "</UL>\n" +
    "</BODY></HTML>");
    This is the content of file web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
    http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <servlet>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <servlet-name>ThreeParams</servlet-name>
    <servlet-class>coreservlets.ThreeParams</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ThreeParams</servlet-name>
    <url-pattern>/servlet/coreservlets.ThreeParams</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
    <welcome-file>ThreeParamsForm.html</welcome-file>
    </welcome-file-list>
    </web-app>
    and this is the content of
    ThreeParamsForm.html
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>ThreeParamsForm.html</title>
    </head>
    <body>
    <h1 align="center">Collecting three parameters</h1>
    <form action="/servlet/coreservlets.ThreeParams">
    First Paramter: <input type="text" name="param1" size="25"><br>
    Second Paramter: <input type="text" name="param2" size="25"><br>
    Third Paramter: <input type="text" name="param3" size="25"><br>
    <center><input type="submit" value="Submit"></center>
    </form>
    </body>
    </html>

    The problem that I am having is when I start the web server I am able to go to the main page.
    http://localhost:8080/ThreeServlets/
    but when I click submit button it passed the parameters to the URL which becomes
    http://localhost:8080/servlet/coreservlets.ThreeParams?param1=fjdskj&param2=dlds&param3=jdsj
    but it is not able to display the page which displays the parameter.Instead it gives the IE pages which says
    THE PAGE CANNOT BE DISPLAYED.
    When I click in the view source of the page which should show the parameter it shows the following html code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <html>
    <head>
    <style>
    a:link               {font:8pt/11pt verdana; color:red}
    a:visited          {font:8pt/11pt verdana; color:#4e4e4e}
    </style>
    <meta HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
    <title>HTTP 400 - Bad Request</title>
    </head>
    <script>
    function Homepage(){
    // in real bits, urls get returned to our script like this:
    // res://shdocvw.dll/http_404.htm#http://www.DocURL.com/bar.htm
        //For testing use
        //DocURL = "res://shdocvw.dll/http_404.htm#https://www.microsoft.com/bar.htm"
        DocURL=document.location.href;
        //this is where the http or https will be, as found by searching for :// but skipping the res://
        protocolIndex=DocURL.indexOf("://", 4);
        //this finds the ending slash for the domain server
        serverIndex=DocURL.indexOf("/", protocolIndex + 3);
        //for the href, we need a valid URL to the domain. We search for the # symbol to find the begining
        //of the true URL, and add 1 to skip it - this is the BeginURL value. We use serverIndex as the end marker.
        //urlresult=DocURL.substring(protocolIndex - 4,serverIndex);
        BeginURL=DocURL.indexOf("#",1) + 1;
        urlresult=DocURL.substring(BeginURL, serverIndex);
        if (protocolIndex - BeginURL > 7)
            urlresult=""
        //for display, we need to skip after http://, and go to the next slash
        displayresult=DocURL.substring(protocolIndex + 3, serverIndex);
        var aElement = document.createElement("A");
        aElement.innerText = displayresult;
        aElement.href = urlresult;
        homepageContainer.appendChild(aElement);
    function doSearch()
        saOC.NavigateToDefaultSearch();
    function initPage()
        document.body.insertAdjacentHTML("afterBegin","<object id=saOC CLASSID='clsid:B45FF030-4447-11D2-85DE-00C04FA35C89' HEIGHT=0 width=0></object>");
        Homepage();
    </script>
    <body bgColor="white" onload="initPage()">
    <table width="400" cellpadding="3" cellspacing="5">
      <tr>
        <td id="tableProps" valign="top" align="left"><img id="pagerrorImg" SRC="pagerror.gif"
        width="25" height="33"></td>
        <td id="tableProps2" align="left" valign="middle" width="360"><h1 id="term1"
        style="COLOR: black; FONT: 13pt/15pt verdana"><span id="pageNotFound">The page cannot be found</span></h1>
        </td>
      </tr>
      <tr>
        <td id="tablePropsWidth" width="400" colspan="2"><font id="LID1"
        style="COLOR: black; FONT: 8pt/11pt verdana">The page you are looking for might have been
        removed, had its name changed, or is temporarily unavailable.</font></td>
      </tr>
      <tr>
        <td id="tablePropsWidth" width="400" colspan="2"><font id="LID2"
        style="COLOR: black; FONT: 8pt/11pt verdana"><hr color="#C0C0C0" noshade>
        <p id="LID3">Please try the following:</p><ul>
          <li ID="list1">If you typed the page address in the Address bar, make sure that it is
            spelled correctly.<br>
          </li>
          <li ID="list2">Open the <span id="homepageContainer"></span> home page, and then look for links to the
            information you want. </li>
               <li id="list3">Click the
               <a href="javascript:history.back(1)">
               <img valign=bottom border=0 src="back.gif"> Back</a> button to try another link. </li>
          <li ID="list4">Click <a href="javascript:doSearch()"><img border=0 src="search.gif" width="16" height="16" alt="search.gif (114 bytes)" align="center"> Search</a> to look for information on the Internet. </li>
        </ul>
        <p><br>
        </p>
        <h2 ID="errortext" style="COLOR: black; FONT: 8pt/11pt verdana">HTTP 400 - Bad Request<br>
        Internet Explorer </h2>
        </font></td>
      </tr>
    </TBODY>
    </table>
    </body>
    </html>

  • XSQL Servlet Page Processor 0.9.8.6 won't run

    Hi...
    I just upgraded the Servlet and keep getting
    XSQL-003: Failed to find 'XSQLConnections.xml' file in server CLASSPATH.
    XSQL-004: Could not acquire a database connection named: demo
    XSQL-007: Cannot acquire a database connection to process page.
    The classpaths are all setup correctly and the previous version worked fine. The
    setup xml file (XMLConfig.xml) is in the classpath.
    From what i can see, XSQLConnections.xml is
    not even included in the distribution so i don't understand why i get this error.
    I am using Apache + Jrun 2.3.3
    thanks for any help
    null

    That error message is outdated and should read:
    Cannot find XSQLConfig.xml in your server-side classpath. The error is definitely that it's not finding XSQLConfig.xml on your classpath. The likely cause is that you did not add the directory:
    ./xsql/lib
    to your CLASSPATH in the JRun Servlet Engine Java environment.

  • /servlet/page error in portal3p

    Experts,
    I had upgraded my Portal to 3.0.9 and i am unable to launch the Portal. My diag.cmd says all are fine. The jserv is also fine because my ip/servlet/IsItWorking is working fine. But one thing i notice is I am able to lauch the DAD config portal (i.e) ip/pls/admin_/ page but this does not ask for a login as it is supposed to do in the latest version. Any body has any idea how to solve this?
    Thanks in advance,
    Ranga

    Experts,
    I had upgraded my Portal to 3.0.9 and i am unable to launch the Portal. My diag.cmd says all are fine. The jserv is also fine because my ip/servlet/IsItWorking is working fine. But one thing i notice is I am able to lauch the DAD config portal (i.e) ip/pls/admin_/ page but this does not ask for a login as it is supposed to do in the latest version. Any body has any idea how to solve this?
    Thanks in advance,
    Ranga

  • Struts/servlet page flow problem due to j2ee security

    Whe I type url such as http://localhost:7777/myapp/action.do, I want to see the execution result page from this action. However the result page will always be index.jsp because j2ee security which I have a loginaction.do and its result page is index.jsp. How can I have overcome this problem.
    Thanks,

    To give more details about the problem I have, user likes to put a URL in the browser, then press enter. User likes to see the running results. However, user is not able to see the results because j2ee security requires user log in. After sucessful login, user is going to see the index page. My question is how user be able to view his result page after login.
    cheers.

  • Weblogic 5.1 - Attributes in servlet Page Context

              Looks like Weblogic 5.1 only supports "String" for attributes and parameters in a servlet pageContext . I wanted to make use of boolean and int but I received wrong values . When changing to String , everything works fine . Does anyone knows about this issue ? Please email me at [email protected] if you can help me with this .
              Thanks,
              Daniel
              

              Looks like Weblogic 5.1 only supports "String" for attributes and parameters in a servlet pageContext . I wanted to make use of boolean and int but I received wrong values . When changing to String , everything works fine . Does anyone knows about this issue ? Please email me at [email protected] if you can help me with this .
              Thanks,
              Daniel
              

  • Compiling my first servlet page

    Hi,
    Im not able to compile my servlet.The servlet code is in desktop\java.The servlet.jar is in c:\program files \ apache tomcat 4.0\common\lib
    when i give this command
    javac HelloServlet.java -classpath " c:\--------" it is not working.I dont know whether this is correct.Please help me out.

    Adding the servlet.jar to tomcat won't make the java compiler know where it is unless the code is called from an application in the web container.
    use javac -cp "filename"
    Otherwise I'd suggest you'd get an IDE to which you add the jar and then compile using the IDE.
    Don't waste your time with javac!

  • Servlet page can't run

    Hello buddies,
    I am very new with servlet. I encountered some problems during browsing my frist servlet for my personal testing.
    I am using Apache Tomcat/4.1.29 as webserver. So I configured as followed inside web.xml which is under Web-INF folder. What happened was just after updating xml file, my applicaiton is failed to start.
    Can anybody help me.... please.
    The configuration I made inside web.xml is as followed.
    <web-app>
    <servlet-mapping url-pattern='/hello'
    servlet-name='hello-world'/>
    <servlet servlet-name='hello-world'
    servlet-class='test.HelloWorld'>
    <init-param greeting='Hello, World'/>
    </web-app>
    Yr reviewing & help is very much appreciated.
    Thanks so much!
    Chan Myae
    Edited by: ChanMyae on Oct 29, 2007 8:55 AM

    The web.xml snippet you've shown is quite wrong. This is how it should be:
    <web-app>
        <servlet>
            <servlet-name>MyServletName</servlet-name>
            <servlet-class>my.package.MyServletClass</servlet-class>
            <init-param>
                <param-name>myParamName</param-name>
                <param-value>myParamValue</param-value>
            </init-param>
        </servlet>
        <servlet-mapping>
            <servlet-name>MyServletName</servlet-name>
            <url-pattern>/hello</url-pattern>
        </servlet-mapping>
    </web-app>You can then access this servlet as http://servername/webAppName/hello
    Where did you get that web.xml structure anyway? You should probably steer clear of that source.
    Also, 4.1 is quite an old version. There have been many changes in Tomcat as well as the Servlet and JSP specs. I'd suggest you upgrade.
    P.S. The next time you post, please use code tags. Above the text area while posting/ editing, you'll see a button labelled 'code'. Use that.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    Edited by: nogoodatcoding on Oct 29, 2007 9:47 PM

  • Reports Servlet - Page not found

    Hi,
    We have problems with OracleAS Reports Services. We have installed oracle applicaction server 10g and we create a standalone report server, but when we issue
    http://<server>:7778/reports/rwservlet
    we get "Page not found" error. We looked at the error.log in Apache/logs directory and it gives:
    File does not exist: /app/oracle/product/Reports/Apache/Apache/htdocs/reports/rwservlet
    What is the issue? I checked the repserver.conf file, opmn.xml, tnsnames.ora, rwservlet.properties.
    Help please. Thanks in advance...

    Hello,
    In order to "forward" the request to the OC4J OC4J_BI_Forms , some settings are required :
    Could you check that mod_oc4j.conf in included in httpd.conf ?
    In $ORACLE_HOME/Apache/Apache/conf/httpd.conf
    # Include the mod_oc4j configuration file
    include "d:\oracle\unified\Apache\Apache\conf\mod_oc4j.conf"
    Then, check that there is an Oc4jMount directive for reports :
    In $ORACLE_HOME/Apache/Apache/conf/mod_oc4j.conf
    Oc4jMount /reports OC4J_BI_Forms
    Oc4jMount /reports/* OC4J_BI_Forms
    Regards

Maybe you are looking for

  • After upgrading to version 4.0 my email money bank transfers do not work. Bank says it is browser issue but what is the setting that needs to be changed?

    I do a great deal of online banking. Recently issue an email money transfer from an account with one bank to an account with a different bank. Have done this regularly in the past with no problems. The transfer could not be completed. After consultin

  • Sending e-mails in Oracle 10g

    Hello, all I have a query that returns on average ~150 rows. I want to set up a job to spool the query's results to a .txt or .csv file and then e-mail it as an attachment. I am using the sys.utl_mail package to send other query results, however when

  • New Macbook Pro to be 64bit?

    Are the Core 2 Duo processors that are expected to be used in the Macbook Pro 64bit? I see that the iMac is 64, but as I understand it, their C2D is a slightly different kind, no? MacBook Pro 17" 2gig Ram 7200rpm   Mac OS X (10.4.6)  

  • EHS-Error while editing Report template

    Hi Gurus I am getting a vague error while trying to cancel release of existing report template. I need to edit the same. Hence i am cancelling the release. Please let me know if any of you have got this error before and how did you solve it?. Also i

  • Color Separations When Using "Print Booklet" feature

    My document has a 2-color logo (black & spot PMS 485) and a 10% black screen on it.  When I make a pdf using the export to pdf everything breaks out correctly.  When I use the print booklet feature and "print" it as a pdf or postscript it changes som