Find in the filename of the jsp page that is included

i have a main.jsp that includes a menu.jsp page dynamically :
if (request.getParameter("view")!=null){
               include_h_menu_page = request.getParameter("view);
<jsp:include page="<%= include_h_menu_page%>"/>
now i am in the menu.jsp and here i want to find out the given name of the page. In my case i want to recive back "menu.jsp". How can i do it?

Remember, that your JSP get's compiled into a servlet!
You are able to get the name of this servlet-class, which may look like:
org.apache.jsp.path.to.your.main_jspbut I think the name can change depending on your appserver.
For this you should be able to usethis.getClass().getName()

Similar Messages

  • Is there a way to automatically add the filename in the page header when batch printing text files directly from finder?

    hello, i have 80 text files (docx). the finder preview works great and i can open them in pages.
    I need to batch print them from finder:
    I select all the documents > drag on printer's icon> printer puts them in queue ( after an on the fly pdf conversion)  ad starts printing.
    BUT
    i need the filename printed on each page  ( in hearder or footer) , not only the regular text content.
    Do you know if there is a workaround?
    thank you
    Tullio

    If that section has an ID or NAME attribute then you can add that to the URL (#anchor) that you want to reload.
    See View > Page Source
    https://support.mozilla.com/en-US/questions/774792#answer-128100

  • How to get the filename of the active jsp page?

    how can i get the filename of the active jsp page?

    You could register the JSP [ages in the web.xml and then use the ServletConfig.getServletName.
    You could use the JspContex.getServletName which will return the registered name or the name of the servlet class.
    You could programmatically add a page context attribute that holds the jsp page name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to call the crystal report in jsp page

    dear friends
    i want to run or call the crystal report in jsp page.
    if u know that can u send sample code for that to my id
    [email protected]

    Hi Sudhakar,
    Could you please be more speicific about the task you want to accomplish?
    Cheers
    Giri :-)

  • Safari and firefox 'cannot find the server' for every other page that i navigate to, unless I turn Wifi off and on. How do I fix this?

    Safari and firefox 'cannot find the server' for every other page that i navigate to, unless I turn Wifi off and on. Once i reconnect to the network, the page loads, but after loading a few more pages, the same thing happens all over again.
    This happens each and every time, on different Wifi networks, in different locations.  On the other hand, I don't ever encounter this problem when I tether my laptop to my mobile phone's 3g/2g network using Personal Hotspot. How do I fix this?

    Try this DNS server ...
    Open System Preferences > Network > Advanced > DNS
    Click + and type:
    208.67.222.222
    Click + again and do the same.
    208.67.220.220
    Click OK.
    Quit and relaunch both your browsers to test.
    If that doesn't help, try here >  iOS: Troubleshooting Wi-Fi networks and connections
    And here >  Wi-Fi: How to troubleshoot Wi-Fi connectivity

  • How can I stop the execution on a JSP page and start it again

    Hi
    I am making a program that simulates how to manage transactions when accessing a database by using locks. I have run into a problem and I hope someone has the time to help me.
    When a user does an update the transaction commits and releases its locks when the program executes
    <%stmt.executeUpdate("commit!"); %>
    I need to put a break in to stop the program executing this statement, to illustrate the lock is set correctly.
    I have tried to put in an alert box but this does not prevent the rest of the java code being executed.
    I have tried to use prompt boxes, JavaScript functions, but these functions cannot have any java code in them.
    I have tried using the java.swing JOptionPane boxes but this didn?t work either
    I have tried to get input from the user but I don?t know how to retrieve this data on the same page. (As far as I know you have to use submit and even refresh the page or retrieve it on the next page).
    Does anyone know how I can stop the execution on a JSP page and start it again (on same page)
    Mette

    I already have another client (Tomcat jsp application) running and it throws a SQLException correctly when I don�t put in a commit=true statement and don't close the database connection.
    But the problem is how to get the code above to stop to illustrate I have set this lock.
    I have tried to use the JOptionPane but because my program is running in a web browser I cannot use the JOptionPane dialog box.
    I have tired using an alert box but it executes the commit statement before the alert box is dispayed. So this does not work
    While (i < 2)
    if( i==1)
    %>alert(�The transactions commits when you press Ok�); <% //what it to stop execution here
    else
    stmt.executeUpdate(�commit�);
    I am not using threads so I cannot use the sleep function.
    I am using mysql and have already configured it to detect deadlocks and how long to wait for locks.
    Thanks for your help
    Mette

  • How can I get the "pageContext" object in jsp page?

    Hi everyone:
    I want to get struts's DataSource object in jsp page.So I should get the PageContext object in jsp page.My code is:
    ///////////////////datatest.jsp///////////////////////////////////
         DataSource ds=(DataSource)pageContext.getAttribute(Action.DATA_SOURCE_KEY);
         conn=ds.getConnection();
              stm=conn.createStatement();
              rs=stm.executeQuery(insertsql);
    Is right?But I get the "NullPointerException" error in Tomcat.The connection pool in struts-config.xml is:
    <data-sources>
    <data-source key="mydatasource">
    <set-property property="autoCommit"
    value="false"/>
    <set-property property="description"
    value="MyWebSite Data Source Configuration"/>
    <set-property property="driverClass"
    value="org.gjt.mm.mysql.Driver"/>
    <set-property property="maxCount"
    value="4"/>
    <set-property property="minCount"
    value="2"/>
    <set-property property="password"
    value="qijiashe"/>
    <set-property property="url"
    value="jdbc:mysql://localhost:3306/myweb"/>
    <set-property property="user"
    value="lyo"/>
    </data-source>
    </data-sources>
    I can query the database in servlet.
    I think the method that I get the context is not right.Had someone get the pagecontext in jsp page?help :(

    Sorry I forgot that I had change the code:
    DataSource ds=(DataSource)pageContext.getAttribute(Action.DATA_SOURCE_KEY);
         conn=ds.getConnection();
              stm=conn.createStatement();
              rs=stm.executeQuery(insertsql);
    to the code:
    DataSource ds=(DataSource)pageContext.getAttribute("mydatasource");
         conn=ds.getConnection();
              stm=conn.createStatement();
              rs=stm.executeQuery(insertsql);
    mydatasource is the struts datasource in "struts-config.xml". I couldn't work

  • How update the info on same Jsp page

    i have a Jsp page.on left side of this page having menu bar. in this menu bar having links of some colleges.
    i want when i click on link of first college name, same page should be updaed with updated menu bar where i can show the information of the concerning college.
    please focus on this.

    I have two Jsp pages named bestschool.jsp and schoolnames.jsp.
    I am calling schoolnames.jsp from bestschool.jsp.
    I want when I click the link on INDUS School. It can show all concerning link of INDUS School links like profile, result, facility etc. in the same place instead of other naming school links.
    my requiremet main is i want to update the information on same Jsp page.
    How can I implement this with in Servlets/Jsp.
    Please review below JSP’s files
    schoolnames.jsp
    <table width="200" border="0" align="center" cellpadding="5">
    <tr>
    <td height="100" bgcolor="#476bc0">
    <div align="center" class="boldhead"><font size="+1">
    School list</font></div>
    </td>
    <tr>
    <td height="30" bgcolor="#5577C6">
    <a href="" class="smalltext">INDUS School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">Vaise School</a>
    </td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.G.V School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.P.S School </a></td>
    </tr>bestschool.jsp
    <html>
    <head>
    <title>Best school</title>
    <link href="mystyle.css" rel"stylesheet" type="text/css">
    </head>
    <body>
    <div align="center"><font size="+2">
    Best Schools in Rohtak</font>
    </div>
    <table width="700" height="500" border="0" align="left"
    cellspacing="0">
    <td width="200" rowspan="2" valign="top">
    <%@ include file="schoolnames.jsp" %>
    </td>
    <td height="328" bgcolor="#476BC0" valign="top">
    <p> </p><p> </p><p> </p>
    </html>please suggest.

  • My servlet cuts off the rest of my jsp page on Tomcat !

    I'm using the Oracle Jdevloper 9i to create a web application. I will then deploy the application to a Tomcat server. Now here is the problem. When developing and running on the Oracle OC4J server the application works fine but after deploying to the Tomcat, my included servlet cuts off the rest of my jsp page. The page runs fine and the first servlet gets executed. After the servlet there should be more jsp code, but after the execution the servlet the remaining jsp code simply disapears. Any Idea anyone ?

    A jsp page ending abruptly looks like a runtime error happening in the included servlet.
    Try commenting the line including the servlet.
    You may also want to check for errors in the servlet by invoking the servlet alone frm the browser.

  • Capturing the output of a JSP page as HTML

    Hi,
    Can anyone tell me if this is possible. I have a JSP page that contains
    information about an order that was just entered (Essentially a
    confirmation page). What I want to do is somehow intercept the output
    stream inside the JSP page and write it to a file, as plain html, which
    I
    will later attach to an email and send to someone.
    Thanks,
    Jordi
    Jordi Pinyol Essi Projects
    Ingeniero de Desarrollo
    [email protected] t +34 977 221 182
    http://www.essiprojects.com f +34 977 230 170

    You won't be able to "intercept" the output since it is the JSP page itself that is doing the writing.
    Will the file that you write the output to reside on the client side or the server side? It sounds like you want to receive the HTML output not as something to view on the browser, but a file you can save and send and use later. If this is the case, one technique that might work is to take advantage of the servlet name mapping feature that is available for registered JSP pages.
    Assuming your JSP pages are registered, you would map your JSP page like:
    <servlet>
    <servlet-name>confirmation</servlet-name>
    <jsp-file>confirmation.jsp</jsp-file>
    </servlet>
    <servlet-mapping>
    <servlet-name>confirmation</servlet-name>
    <url-pattern>/confirmation.out</url-pattern>
    </servlet-mapping>
    What happens is that a request for the URL /NASApp/myapp/confirmation.out gets mapped to the confirmation.jsp JSP page. If you set your MIME type correctly in the JSP page, the HTML output from the JSP page is not properly recognized by the browser causing it to prompt you to save the file.
    I have used this technique to generated CSV files from a JSP page. The browser is completely fooled.
    JC
    Jordi Pi?ol wrote:
    >
    Hi,
    Can anyone tell me if this is possible. I have a JSP page that contains
    information about an order that was just entered (Essentially a
    confirmation page). What I want to do is somehow intercept the output
    stream inside the JSP page and write it to a file, as plain html, which
    I
    will later attach to an email and send to someone.
    Thanks,
    Jordi
    Jordi Pinyol Essi Projects
    Ingeniero de Desarrollo
    [email protected] t +34 977 221 182
    http://www.essiprojects.com f +34 977 230 170

  • Capturing the output of a jsp page and save that output in a WORD .doc file

    Hi,
    This is Naveen. I got stuck up with a problem/doubt. URGENT ! URGENT !
    My doubt is how to capture the output of a jsp page(the content is dynamic generated) and save that output to a MS-Word doc file.
    I know that therez an option of using Servlets Filters, but this concept is supported by Servlet 2.3 spec. and not earlier. And we are working on previous spec. and our web-servers also supports the prev. version and not the 2.3 version.
    If incase, therez a third-party utility for free usage, suggestions are appreciated.
    Hope most of them came across this kind of functional requirement. If anyone of them succeeded in this, please express ur bitter experience if any, faced during the coding.
    Thanks in Advance for help.
    Naveen

    You can set the MIME content type as .doc and try to open the Page.
    res.setContentType("application/vnd.ms-excel"); to generate the Page output as Excel
    res.setContentType("application/vnd.ms-word"); to generate the Page output as MS Word doc
    Hope this helps..

  • Writing the filename as the prefix for bates or page numbering during batch process.  PRO 9

    While batch processing in Acrobat PRO 9 I am trying to insert the file name as the prefix automaticily either for page numbering or bates labeling.
    Not very good with javascript.  Any one have any ideas?
    Everyone is always asking to have the filename as the prefix and it starts to wear on you after 1000 exhibits.

    Don't know what script you're using, but this command will return the document's file name:
    this.documentFileName
    and this one will return the full path:
    this.path

  • How to see the filename of the photos available in the iphone without downloading them or connecting to any other device

    I am unable to find the filename of the photos available in my iphone 5. How should i get that?

    You can't view that on the iPhone natively.
    You can, however, import the pictures to your PC or Mac and view the file names there. They should be in the IMG_XXX format.

  • Is there a possibility to print the filename into the picture?

    Is there a possibility to print the filenames into the picture or into the slideshow? When presenting photos to clients over Apple TV there must be a way to find the image name for ordering.
    Any ideas, I did not find anything!

    Unsure about slide show in Ap, but when printing llok for this dialogue box, it prints any metadata;
    You just need to select the more options bottom left.
    Tony

  • Processing the filename in the payload

    Hi,
    I am getting the filename in the payload, I want to read that file.
    How do I achieve this..
    Regards,
    Varun

    Hi,
    For Example if we want to get the Input file name & Directory Details into Target message.
    Ex:
    I/P File name is :::::231004.xml  Ftp Serve Path : //xideveloper/Test_XI/PO
    O/P File name can be :::Any thing
    Input File :  231004.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_TEST_AGCO xmlns:ns0="http://tafe.test.com">
       <Header>
          <NAME>giri</NAME>
       </Header>
    </ns0:MT_TEST_AGCO>
    Output File : Out.xml
    Here in this output we are able to get the Filename & Directory Info in the FileName_1 Field.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_target xmlns:ns0="http://test.com">
    - <Header>
      <Name_1>giri</Name_1>
      <File_Name_1>231004.xml //xideveloper/Test_XI/PO/</File_Name_1>
      </Header>
      </ns0:MT_target>
    You should capture the Source File name & Directory Info into Target Message.
    1)     Write One UDF & Map Like Constant(u201Cu201D)---UDF----FileName_1
    2)            In Advanced mode check the check box Set Adapter-Specific Attributes
    3)     Check the ASMA Parameters in Sender Adapter Alone
    4)             No need to check the check box ASMA in the receiver side
    UDF Code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //for getting filename
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //for getting directory
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    /similarly for getting filetype, filesize you need to specify in the above code instead of filename or directory/
    String FileName = conf.get(key1);
    String Directory = conf.get(key2);
    String Cat = FileName+ " "+Directory;
    //return FileName;
    //return Directory;
    return Cat;
    Regards
    Seshagiri

Maybe you are looking for

  • NetBoot/NetInstall settings in Server Admin buggy as ****?

    Hi, I administer a Mac pool in College. We recently updated to all new iMacs (except for one, which still is a 2006 C2D iMac) and Leopard Server running on a PowerMac G4 (Dual 1GHz, 1.5 GB RAM). Except for a few initial quirks with Directory Services

  • Width between two columns.

    hello every one,i have a table which hve column of varchar2(100),number and so on. when i describe the table the data type are display much away from column name. i scroll then see its data type ,there is any way i can see close them.thanxxx

  • Generic bug in Eclipse 3.1M4??

    I gave Eclipse 3.1M4 a try and noticed a bug(?)/ feature(?) in a code like the following: class Test implements Iterator<Integer> {     public boolean hasNext() { return false; }     public Integer next() { return null; }     public void remove() {}

  • Aol password not accepted how do I update existing apps?

    After downloading iOS5 my phone asked me to input apple id and I saw this as an opportunity to update from my aol account which I don't use anymore to a newer id. Since then everytime an app shows an update is available the phone still asks for the p

  • Curious numbers from T3s

    Below is the output from running the "fru st" command on my T3. I do not understand why there are no statistics for the disks labeled "u2dX". This output is from 2 units paired together in a "partner group." Can anyone explain this for me? Thanks. ==