Using a URL parameter by the JSP to pull in an html file for dynamic content ??

I would like to have a simple jsp which could be called from an URL
          with a parameter. I'd like the parameter to be used by the JSP to form
          a filename of a second file. This second will be a chunk of HTML
          which is sucked in to the JSP to form some content in a particular
          HTML table cell.
          The ASP is this :
          <%
          targetPath = Server.MapPath(Request.QueryString("Content")+".txt")
          // makes a variable called targetpath which is a filename called
          something.txt
          Dim filesys, myloadedfile, line
          Set filesys = CreateObject("Scripting.FileSystemObject")
          Set myloadedfile = _
               filesys.OpenTextFile(targetPath,1,0)
          Do
          // loops round each line of the something.txt file putting them in the
          JSP
               line = myloadedfile.Readline
          %>
          <%=line%>
          <%
          Loop Until myloadedfile.AtEndOfStream
          myloadedfile.Close
          %>
          Please can someone help me out with some info on the JSP equivalent
          please?
          Thanks Heaps
          Rob
          

          See Content tag on http://www.servletsuite.com/jsp.htm
          This custom tag lets to add any file (even the outisde
          of your web application).
          [email protected] (rob) wrote:
          >I would like to have a simple jsp which could be called from an URL
          >with a parameter. I'd like the parameter to be used by the JSP to form
          > a filename of a second file. This second will be a chunk of HTML
          >which is sucked in to the JSP to form some content in a particular
          >HTML table cell.
          >
          >The ASP is this :
          >
          ><%
          >targetPath = Server.MapPath(Request.QueryString("Content")+".txt")
          >// makes a variable called targetpath which is a filename called
          >something.txt
          >
          >Dim filesys, myloadedfile, line
          >Set filesys = CreateObject("Scripting.FileSystemObject")
          >Set myloadedfile = _
          >     filesys.OpenTextFile(targetPath,1,0)
          >Do
          >// loops round each line of the something.txt file putting them in the
          >JSP
          >     line = myloadedfile.Readline
          >%>
          ><%=line%>
          ><%
          >Loop Until myloadedfile.AtEndOfStream
          >myloadedfile.Close
          >%>
          >
          >Please can someone help me out with some info on the JSP equivalent
          >please?
          >
          >Thanks Heaps
          >
          >Rob
          

Similar Messages

  • How to use custome tag lib in the JSP page?

    How to use custome tag lib in the JSP page?...with JDeveloper

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtTopicFile.working_with_jsp_pages%7Cjsp_ptagsregistering~html/

  • Hi, my MacBook Air is not working anymore if it's not connected with the power cable. It's pretty new so I can't imagine that the battery is dead already. Why can't I use my MacBook Air without the power cable even though I charged it for hours?

    Hi, my MacBook Air is not working anymore if it's not connected with the power cable. It's pretty new so I can't imagine that the battery is dead already. Why can't I use my MacBook Air without the power cable even though I charged it for hours?

    Please take the Mac to  Apple store to have it checked out.
    Genius Bar reservation
    http://www.apple.com/retail/geniusbar/
    Best.

  • Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotfo

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

    Hi I want to create a search form with drop down search criteria. This form should then search on the same site and display the search results. Is there HTML available for this? Or an oline site that I can use to build this form? I created a form in Jotform.com, but this form doesn't search the site, instead it sends me an e-mail. Do you have a solution for me? Thanks.

  • I am trying to upgrade to itunes 10.7 using windows and keep getting the following error message: "Error writing to file: C:\Config.Msi\364460.rbf   Verify access to this dierctory". Help!

    I am trying to upgrade to itunes 10.7 using windows and keep getting the following error message: "Error writing to file: C:\Config.Msi\364460.rbf   Verify access to this dierctory". Help!

    Fixed! (win7 64 bit)! Just stop your antivirus during the upgrade/installation (I've got Kaspersky).
    Good luck!

  • Is it possible to check the previous backups on a certain backup file for the iPhone.

    Is it possible to check the previous backups on a certain backup file for the iPhone. I need to backup and restore the files which were used in the second week of January, but now I am only able to see the latest iteration of the backup. I am assuming that the iPhone backup rewrites on the same set of files. I may be mistaken. Is there any work around to see the old backups? Any kind of help would be seriously appreciated.

    You can use zoom: Settings>General>Accessibility.
    " A simple double-tap with three fingers instantly zooms in 200 percent, and you can adjust the magnification between 100 and 500 percent."

  • I have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember where I got the software and the

    I have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember have an attachment to my iPod Classic that allows me to record. However, when the hard drive died on my last computer I lost the software that allowed me to transfer files for burning CD's or email, etc. I don't remember where I got the software and the package with the instructions is long gone. Anyone know where to get it?

    What is the make and model of this recorder?  Do you have that information available?
    You can still use iTunes to transfer and manage your recorded audio.
    iPod: Recording voice memos
    B-rock

  • HT2486 how can I export the contact book data to a csv file for editing?

    how can I export the contact book data to a csv file for editing?

    You can edit a card right in Contacts. No need to export and re-import.
    Select a name and on the right side, click the Edit button:

  • Using a URL parameter in SQL Query

    Newbie question...
    I have been developing a dashboard application, and I have been using input bind variables in the SQL. That all works fine.
    What I would like to do is to have a user go to a page via a URL with paramaters like this:
    http://atlas:7777/pls/apex/f?p=112:1:9191429456552868531:::::P1_ITM_CD_PASSED:JMINV
    where P1_ITM_CD_PASSED is the parameter and JMINV is the value.
    Then, I want the SQL to execute using that:
    select *
    from itm
    where itm_cd = ': P1_ITM_CD_PASSED'
    I tried testing this on a page. Set up a report region, but it appears that the paramater is not making it to the SQL. "No Records Found".
    Is there a simple example out there that anyone knows of? Maybe I am missing an item, computation, process, etc. to be able to utilize the paramater?
    Thanks in advance

    varad
    Thanks for the reply. I did try that, and same results. It seems that the parameter is not getting bound to the variable, or it's getting flushed after the page loads. Here is what debug shows me:
    P1_TEST
    0.08: show report
    0.10: determine column headings
    0.10: activate sort
    0.10: parse query as: CUSTOM
    *0.11: binding: ":P1_ITM_CD_PASSED"="P1_ITM_CD_PASSED" value=""*
    0.11: print column headings
    0.11: rows loop: 15 row(s)
    no data found
    Edited by: jmcclain on May 13, 2010 4:01 PM

  • How can I invoke a JSP using a URL instance from another JSP?

              Hi all.
              I've been developed a J2EE application using Oracle 9iAS.
              Now I'm migrating to WL Server and I have the following problem.
              I was using the following code to read a URL contents from another JSP:
              URL url = config.getServletContext().getResource("/path/to/url/of/textfile.xsl");
              This was working fine in a expanded directory project structure (typical during
              development time) and Oracle 9iAS.
              When I execute this code from my WL packed .ear file I get a URL not found exception.
              Which is the right way to get a resource available from the same context root?
              Thanks in advance for your answers (and sorry for my bad english ;-))
              

    The previous owner of that machine should have wiped it and install the original OS that shipped with the system leaving the system at the point where the new owner takes over and enters all there own information.
    Before you go much further with this machine you should seriously consider backing up any new stuff you have done and wiping it and starting from scratch. If you keep the system like it is you  will be plagued with problems. Even doing OS updates will prove frustrating.
    Right now the best you can do is to move the Aperture that is on the system into the trash, log into the App Store using your ID and buying Aperture. That should work but to be honest I have never had to do it so can;t say for sure.
    You might want to look at this What to do before selling or giving away your Mac from Apple to read what they recommend.
    good luck
    regards

  • Using/calling  a parameter in the SQL Query!

    Hi
    How do I use or call a parameter from the parameterform in my SQL query in Reports ??
    Thanks in advange *S
    /Stig :-)

    If you have user parameters of P_BEGINDATE and P_ENDDATE, in your query you would reference them by the following:
    FROM auditlog
    WHERE (eventtimestamp between :P_BEGINDATE and :P_ENDDATE
    or :P_BEGINDATE IS NULL)
    If you are using the report through Oracle Applications Concurrent Manager make sure the Token (when setting up parameters for the concurrent program)matches the user parameter exactly.
    - Rob

  • Using a type parameter at the 'wrong' time?

    I tried to make a subclass of SwingWorker using...
    private class ProcessSAV<Void, String> extends SwingWorker {...}...and in the doInBackground() method, I declared and initialized a local variable...
    String filename = "blahblahblah";Somehow, I manage to get an incompatible types compile-time error at this line of code.
    found: java.lang.String
    required: String
    I know that the second type parameter is used to the specify the object type in publish() as well as the List type in process(). When I declare a String as the local variable in this instance, it seems to be a unique type related the second type argument and won't accept anything that returns a java.lang.String.
    Why is it doing this? And is there any way to get around it?

    You created two type parameters having the names of classes, thus the String you refer to actually is a type parameter, not the String class.
    You most probably wanted to do the following:private class ProcessSAV extends SwingWorker<Void, String> {...}

  • Adding a URL parameter to the path to spry XMLdataset

    anyone know an easy way to code this one.
    I can pull in xml and do what ever I want with it, but I want to pull in an XML page that is generated with the URL parameters of the current page
    so  instead of
    var ds1 = new Spry.Data.XMLDataSet("my_XML.php", "export/row",{useCache:false,loadInterval:2000});
    i'd like the url to include the params of the current page
    in php something like "my_XML.php?jobnumber=".$var1."&version=".$var2 ;
    where var1 and var2 are URL params of the current page URL
    I'm guessing I need to create the javascript equivalent to var ds1 = new Spry.Data.XMLDataSet("my_XML.php",  etc
    but I've got no idea what that might be
    anyone help??

    And Spry version where the URL is myfile.html?file=employees
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>Untitled Document</title>
    <script src="SpryAssets/xpath.js"></script>
    <script src="SpryAssets/SpryData.js"></script>
    <script src="SpryAssets/SpryURLUtils.js"></script>
    <link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet">
    <script type="text/javascript">
    var params = Spry.Utils.getLocationParamsAsObject();
    var ds1 = new Spry.Data.XMLDataSet(params.file+".xml", "employees/employee");
    </script>
    <body>
    <div class="MasterDetail">
      <div spry:region="ds1" class="MasterContainer">
        <div class="MasterColumn" spry:repeat="ds1" spry:setrow="ds1" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{firstname}<br />
        {lastname}</div>
      </div>
      <div spry:detailregion="ds1" class="DetailContainer">
        <div class="DetailColumn">{firstname}</div>
        <div class="DetailColumn">{lastname}</div>
        <div class="DetailColumn">{joinDate}</div>
      </div>
      <br style="clear:both" />
    </div>
    </body>
    </html>
    The URL parameters can be adjusted to suit.
    Gramps

  • Is there a way to login to Iplanet 5.2 by using a URL that contains the login and password (without using the form) ?

    I would like to be able to login to Iplanet using a URL like this:
    http://server:port/<exec>?user=john&password=doe
    or like http://user:password@server:port/<some_params>
    I knew how to do it with SIMS 4, but with Iplanet 5.2 I just don't have a clue. Do you know how to do that?

    http://server:port/login.msc?user=john&password=doe
    This works for me.
    Regards,
    Niels

  • Pass parameter to the jsp include

    Hello,
    Is it possible to pass a string to the <jsp:include page ?
    Thanks!
    ~ Kyle

    Use jsp:param.

Maybe you are looking for

  • Error: Invalid Password when trying to sign in on any wireless devise

    Error:  Invalid Password when trying to sign in on any wireless devise I even reinstalled my WRT110 to be sure of the Network Name and Password but I still get this error.  I have never been able to log in to the wireless network.  I can see it - Ien

  • Quicktime doesn't show up

    I just posted a website with a few Quicktime files. They do not show a thumbnail. I dragged them in after I "saved as" Quicktime for the web. It told me the files might be too big as I dropped them in the page. They are about 10-12 MGB. What am I doi

  • How do you update the SIM card on your account?

    #1. < Edited for language by Host > I just thought that needed to be said. I had a texting problem with my iPhone and found out after 6 hours on the phone that I needed to get a new SIM card. I went to the store and picked it up. I asked them to help

  • Modify SQL Query

    Hi, Can the below SQL Query be modified in any simpler way. IF (V_BillingTypeID = 2) THEN     select count(*)       into V_AuthCount       from payerauthorization pa      where pa.patientidentificationno = IV_PatientIdentifierno        and pa.registr

  • Cwserial in Windows XP

    Hello, we are involved in the development of an application (written in VB6) which controls an enviromental sensor via RS-232. For this task we  use the CWSerial class which is embedded in the cwinstr.ocx ver. 3.0.3. Everything  works well under Wind