Get context path in a jsp without using a scriptlet

Hi Guys
I am using Scriptlet to get a application context path in a JSP. I want to get the context path with out using an scriptlet in a JSP, is there way to achieve this..?
<%=request.getContextPath() %>/listofvalues.do?method=viewListOfValues thanks in advance.
Regards
Praveen
Edited by: praveen_kumarvr on Jul 3, 2008 8:30 AM

${pageContext.request.contextPath}A common practice is to put this value in the <base href> in the HTML head and then use this as the root for all of the relative URL's in the page.

Similar Messages

  • Get site id in WCS jsp without using ics.SQL

    Hi,
    Is there a way i can get siteId of my current site in JSP without using ics.SQL tags and getting it from publication table
    We are trying to implemet a lucene search for loading assets present in current site only.
    Thanks in advance for your help.

    Use the below code to get it.
    <publication:load name="thisPub" field="name" value='<%=ics.GetVar("site") %>'/>
    <publication:get name="thisPub" field="id" output="thisPubID"/>
    Dont forget to import publication.tld
    Regards,
    Ravi G

  • How to execute a .exe file in java(Jsp) without using a process ???

    Hi All ,
    How to execute a .exe file in Jsp without using a process ??? ...
    Is it Possiable ????

    itsdhanasaraa wrote:
    But as this a web application ... By using Runtime i'm getting some probs ..
    Let me guess, you want your web application to run a program on the client and to your surprise that's not working?
    Ain't gonna happen.
    its taking more time to execute .... that's y is there any other option to execute .exe file other than Runtime.getRuntime().exec("filename");Write proper English and you may be taken more seriously.
    1) it's not "taking more time to execute", whatever that's supposed to mean.
    2) there's no other way to execute something. Not that you should every use even that way anyway
    3) whenever you start thinking of executing external programs from Java, start thinking of not using Java in the first place.

  • How can I add more than one submit button in a jsp without use of javascrip

    I want to add more than one submit button in a jsp without use of javascript

    you can do add multiple submit button with this way
    <input type="submit" value="Previous" />
    <input type="submit" value="Next" />
    <input type="submit" value="Finish" />

  • I downloaded and paid for an app on my ipad, how can I get it free on my iphone without using itunes as my laytop is broken. I cannot seem to find the purchase tab in app store? I am logged in using the same ID

    I downloaded and paid for an app on my ipad, how can I get it free on my iphone without using itunes as my laytop is broken. I cannot seem to find the purchase tab in app store? I am logged in using the same ID

    First, the app must be universal...designed for both iPhone/iPad:
    Tap App Store.
    Make sure you're signed in with the same Apple ID used for the original purchase.
    Tap Updates.
    Tap Purchased on the resulting screen.
    Locate the app in your Purchased tab.
    Tap the download icon.
    The app will begin downloading and you'll be taken back to your home screen.

  • Does anyone know how to get an application you had once without using App Store?

    Does anyone know how to get an application you had once without using App Store?
    Because I'm underage and I couldn't get it back.
    I just want it back, I'm not going to use any money in App Store...

    When you say you "had it once", how did you get it then?  The App Store has only been around for a few years, so there are lots of apps out there that you would once get from the developer, but now they're only available on the App store.  Which app(s) are you referring to? 

  • How to get context sensitive help  in JSP Pages

    Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
    Thanks

    Java code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
    Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
    Ulrich

  • How to get the Path of the Current File using Import & Export File -Reg.

    Dear all,
    I have a mega (big) doubt. I have manually inserted the Figures from the figure folders. Now i need, fully automated. So How can I get the Figure path
    Example :
    PMString path = "E://development/Figures/";
    now i checked, How many subFolders is there in "path", get the All Subfolders and check to the Article Name.
    Example
    Article Name == subFolder name then get the Files from the SubFolders(E://development/Figures/ChapterF/*.eps files").
    now I paste the Document using to For Loop.
    Please any one can suggest me, How can We get the Path in SDK.
    Note:
    Should I have to create the relative path by myself?
    No method supplied in SDK to do this directly?
    Please I need a help of this Query as soon as posible.
    Thanks & Regards
    T.R.Harihara SudhaN

    http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/input_file.asp?frame=true
    When a file is uploaded, the file name is also submitted. The path of the file is available only to the machine within the Local Machine security zone. The value property returns only the file name to machines outside the Local Machine security zone. See About URL Security Zones for more information on security zones.
    i need to know on how to get the compelete path /directory of the filename
    using <input type="file"> tag You can't. Its a security thing.
    is there any other way to get an input file from a local host aside from <input type="file"> tag?No. Not using just html.
    You could always go into activex components, but thats different again.
    Cheers,
    evnafets

  • Get table cell value on click without using submit or action

    hello ,
    i am having html table containing values retrieved from database.
    i want to create table cell as a link and want to pass cell's value to the next page without using submit, radio button, checkbox.
    it is feasible in PHP and ASP but i want to solve in jsp. pls suggest the solution.
    Edited by: Avinash123 on Dec 16, 2008 2:58 AM

    Here is sample code
    <script type="text/javascript">
    function callForm(data)
    frm.action="anotherjsp.jsp?value="+data;
    frm.submit();
    </script>
    <form name="frm" action="">
    <table id="test" border='1'>
    <tr >
    <td onclick="callForm('Data1')" > Data1 </td>
    <td onclick="callForm('Data2')" > Data2 </td>
    <td onclick="callForm('Data3')" > Data3 </td>
    <td onclick="callForm('Data4')" > Data4 </td>
    </tr>
    </table>
    </form>

  • How do I get context path in javascript?

    Hi,
    I code the following code but the contextPath will return a string = <%=request.getContextPath()%> instead of returning the context path. The codes works on a normal jsp form. Please help. Thanks.
    <script>
    <contents>
    var contextPath = "<![CDATA[<%=request.getContextPath()%>]]>";
    function doAction( action ){
    if( action == "clear" ){
    document.GnCodeSetupForm.action= "clearGnCodeSetupAction.do";
    document.GnCodeSetupForm.submit();
    </contents>
    </script>

    var contextPath = "<![CDATA["+<%=request.getContextPath()%>+"]]>";
    will return following code
    var contextPath = ""+<%=request.getContextPath()%>+"";
    which is syntax error.

  • Including Applets in jsp without using Archive

    Can any one help me to include the Applet without using the Archive attribute in either <jsp:plugin> or <applet> tag. I am using WebLogic workshop8.1 on win 200 platform , it builds class files in a seperate directory which starts with .workshop dirctory. I should include that directory as the codebase for the applet.
    regards
    varada rajulu
    Turning Point Software Solutions India

    yeah. don't use it. You specify the code (class) and the codebase tag, and the classes have to be loose on the server under the package directory structure that the classes' package is set up for.

  • To get the button on system form without using ADDON

    Hello,
    I want to get the new button on tne System Form without creating or using Add-on.
    And while clicking on that button, i want to display "Hello World" message..
    Can u please tell me how to get new button on the System form without using AddOn?
    Thanks
    Nisha

    Hi Nisha,
    It is not possible to add a button on a system form without using an add-on, this is because in order to add a button an a system form you have to access its form id at run time (that converts this standard form into a customized form for your add-on ) the location of some existing control that will be taken as the base location identifier for the new control and only then you would be able to add a new button on the form.
    Regards,
    Prashant

  • How to get full path of a file uploaded using file control on a jsp ?

    Hi all...
    I have a jsp on which i am using a file element (input type="file") to upload files present on the physical file system.. Thats working fine.. But i want to retrieve the full path of the file uploaded for further computation.
    What are the possible ways which can give me the full path ?? (e.g. "D:\data\text\Output.txt" )
    Thanks all for attending the question..
    Regards
    Prasad

    Some browsers send the full path. Some do not.
    You can not affect this in any way shape or form.
    All you can count on receiving is a filename - no path information.
    So you will have to have some other way for the user to pass along this information.
    If they are uploading to a "remote web site" they could specify a folder to put the uploaded file in.
    You could classify it and put all image files in "images" and all script files in "scripts" etc etc by default, and let the user deal with it in their own HTML.
    Hope this helps,
    evnafets

  • Reload / Refresh JSP without using parameters

    Hi,
    I have a servlet, which gets data from a mobile phone and puts the data into a database.
    Then I have a Java Beans that takes data from the database. But I dont pass it with the
    request and response parameters.
    I just use the data like you see below, I use the object of the Java Beans mybean. In
    its constructor I do all the stuffs to read data from database.
    <jsp:useBean     id   = "mybean"   scope    = "session" class = "org.myHalloGMap.handler.Handler" />
    <jsp:setProperty name = "mybean"   property = "*" />The data I use like this:
    <%                                  
         for(int i=0;i<mybean.row_count_coordinates;i++){
                  if(mybean.getUsrn().equals(mybean.coordArrUsername)){
    row_count++;
    So my problem is now:
    How can I refresh my jsp, so that I can display the data, i read out of my database?
    When I use the webapplication and put new data into the database, on my webapplication
    is still shown without the new data. When I refresh the browser, it still shows me without
    new data?
    Can someone help me?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Perhaps the bean should be set to the request scope, since you use the constructor to read all the data from the database. When you use the:
    <jsp:useBean     id   = "mybean"   scope    = "session" class = "org.myHalloGMap.handler.Handler" />You will only create a mybean instance if one doesn't exist. When you first visit to the page the session is new, so you will create the mybean instance. After that, the mybean instance is found in the session so a new one isn't made - which means the constructor isn't called, which means no new data is read.
    If you put it in the request scope then the mybean instance will be re-made each request.

  • Getting context path in a jspx

    Greetings
    i have in a JSP this code
    <div id="footerpartners"><img src="<%=request.getContextPath()%>/images/aval.png" width="68" height="26" /><img src="<%=request.getContextPath()%>/images/ath.png" width="79" height="26" /><img src="<%=request.getContextPath()%>/images/ciudad_empresarial.png" width="133" height="26" /><img src="<%=request.getContextPath()%>/images/corficolombiana.png" width="140" height="26" /><img src="<%=request.getContextPath()%>/images/superfinanciera.png" width="181" height="26" /><img src="<%=request.getContextPath()%>/images/verisign.png" width="72" height="26" /></div>
    and this JSP is being include in a JSPX, when loading the JSPX in my browser i am getting this error
    Error de OracleJSP: oracle.jsp.parse.JavaCodeException:Line 3, oracle.jsp.parse.JspParseTagExpression@190fd9b
    Error: Java code in jsp source files is not allowed in ojsp.next mod
    i believe it is because of the contextPath request....................how can i get it in a jspx

    Try using EL instead of the java.
    ${pageContext.servletContext.contextPath}might work.
    Timo

Maybe you are looking for