Designing the structure of jsp pages using xml

how can i design the structure of the jsp using xml file?

The structure of the JSP? I don't know what that means. Perhaps you can explain why you thought using XML for that would be a good idea, that might help us comprehend the question.

Similar Messages

  • Convert jsp page into xml  or dom for search

    Hello everyone,
    I have to build an application that searches for message beans in all jsp page. I did it the traditional way, using scanner and string methods. Its working but its not perfect. So i want to convert all my jsp page into xml format and then process them. My jsp pages are quite complicated. I used some jars that convert them into jspx . But its not working. Please help
    Thanks in advance

    Well its like this.I need to develop a program that reads all the message bean keys.. We have lots of struts webapps. All messages in the jsp pages have been externalised and internationalised. Now i have to build a program that given a webapp path prints out all the message bean keys used in the webapp. I have developed the program using the Plexus Directory scanner to filter all the jsp pages and java util Scanner to read line by line and used String functions to search for keys.
    Now thats not the best soultion. The best way, imo, is to cinvert the jsp into xml pages and then we can parse the xml pages easily. The' problem is to find a way to convert the jsp pages(jstl +javascript) into xml.
    Can you help me out?
    Thanks

  • How to process the HTMLs or JSP pages?

    Hi all. my program need to process the HTML or JSP pages. But they are different from the XML. When I use SAXParser or something like that to process the HTML, Exception will always occur. Especially for processing the element "<% .... %>". So can anyone teach me the way to processing the HTML or JSP pages?

    These are from a Page Layout document. If you are using Word Processing, the button is called Sections instead of Pages but has the same icon.

  • Unable get complete filepath from jsp page using request.getParameter()

    Hey all,
    i am actually trying to get the selected file path value using request.getParameter into the servlet where i will read the (csv or txt) file but i dont get the full path but only the file name(test.txt) not the complete path(C:\\Temp\\test.txt) i selected in JSP page using browse file.
    Output :
    FILE NAME : TEST
    FILE PATH : test.txt
    Error : java.io.FileNotFoundException: test.txt (The system cannot find the file specified)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:106)
    at java.io.FileReader.<init>(FileReader.java:55)
    at com.test.TestServlet.processRequest(TestServlet.java:39)
    at com.test.TestServlet.doPost(TestServlet.java:75)
    JSP CODE:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>DEMO SERVLET</title>
    </script>
    </head>
    <body>
    <h2>Hello World!</h2>
    <form name="myform" action="TestServlet" method="POST"
    FILE NAME : <input type="text" name="filename" value="" size="25" /><br><br>
    FILE SELECT : <input type="file" name="myfile" value="" width="25" /><br><br>
    <input type="submit" value="Submit" name="submit" />
    </form>
    </body>
    </html>
    Servlet Code :
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException, FileNotFoundException {
    response.setContentType("text/html;charset=UTF-8");
    PrintWriter out = response.getWriter();
    try {
    String filename = request.getParameter("filename");
    out.println(filename);
    String filepath = request.getParameter("myfile");
    out.println(filepath);
    out.println("<html>");
    out.println("<head>");
    out.println("<title>Servlet TestServlet</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h1>Servlet TestServlet at " + request.getContextPath() + "</h1>");
    if (filepath != null) {
    File f = new File(filepath);
    BufferedReader br = new BufferedReader(new FileReader(f));
    String strLine;
    String[] tokens;
    while ((strLine = br.readLine()) != null) {
    tokens = strLine.split(",");
    for (int i = 0; i < tokens.length; i++) {
    out.println("<h1>Servlet TestServlet at " + tokens[i] + "</h1>");
    out.println("----------------");
    out.println("</body>");
    out.println("</html>");
    } finally {
    out.close();
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    processRequest(request, response);
    Needed Output :
    FILE NAME : TEST
    FILE PATH : C:\\Temp\\test.txt
    Any suggestions Plz??

    As the [HTML specification|http://www.w3.org/TR/html401/interact/forms.html] states, you should be setting the enctype to multipart/form-data to be able to upload files to the server. In the server side, you need to process the multipart/form-data binary stream by parsing the HttpServletRequest#getInputStream(). It is a lot of work to get it to work flawlessly. There are 3rd party API's around which can do that for you, such as [Apache Commons FileUpload|http://commons.apache.org/fileupload] (carefully read the User Guide how to use it).
    You can also consider to use a Filter which makes use of the FileUpload API to preprocess the request so that you can continue writing the servlet code as usual. Here is an example: [http://balusc.blogspot.com/2007/11/multipartfilter.html].

  • How to Hightlight the Data in Jsp Page

    How to Hightlight the Data in Jsp Page,
    I am doing doing search page,based on values given search page those are sent to servlet,in servlet based on some conditions if particuler id i am getting then i am redirecting to Respective jsp page with highlight the data from database..
    Thanks in advance...

    "Highlighting data in JSP sounds strange".
    Without looking at your search specific algorithms I feel you are finally going to display a page (HTML content) to user which contains highlighted text. Highlighting is not directly related to server side language you use (JSP, ASP, PHP etc.). This is purely HTML and CSS. However, server side script (such as JSP) should generate HTML content for getting highlight effect.
    Following HTML shows highlighted text using background-color property on span element.
    <html>
      <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
      </head>
      <body>
          <p style="font-size:1.1em">This is a long paragraph which contains <span style="background-color: yellow;">highlighted text</span> and non highlighted text.</p>
      </body>
    </html>Thanks,
    Mrityunjoy
    Edited by: mrityunjoy on 14 Jun, 2010 3:30 AM

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • Creation of a portal page using XML web form

    Hi Experts,
    I want to know how to make a portal page using XML web forms... Please tell me the steps involved in doing the aforesaid.
    Thanks in advance...

    Hi
    You compose page using WPC(Web page Composer), this is a bussiness package, which you need to deploy it on portal server then will get a WPC role which you can assign the user and then user can start composing the using follwoing PDF
    To compose it chect this pdf
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7?overridelayout=true
    Thanks

  • Can we create a pivot table of Excel in a JSP page using POI

    Hello,
    I want to know whether we can create a pivot table of excel sheet in a jsp page using POI package from apache.
    thank you.

    Hi Alex,
    Many thanks for replying.
    I followed the link, but unable to get correct output.. I have shared the template earlier. I can share the template once again.
    It would be grateful if you give me share the working template with table of content.

  • Help needed to create a master-detail JSP page using OAF.

    I like to create a master-detail JSP page using OAF. If any help or guide will be appreciate.
    - Kausik

    A Master Detail Page is a basically a game between two VOs(Master and Detail mostly connected through a View Link). You can also have a look at the View Link section in the Dev guide. Page Layouts is one thing which you can take a call yourself.
    Regards
    Sumit

  • How to do transactions in jsp pages using Java & MySQL ?

    Hi,
    I'm a newbie..
    I'd like to know "How to do transactions in jsp pages using Java & MySQL ?"
    Platform: Windows XP, Apache Tomcat 5.5, MySQL 5, Java bean without EJB
    what are the the different types of transactions? Differences between them?Pls provide examples?
    Which among them is the best method to implement a transaction?
    Pls help me...
    thnx in advance...

    http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html

  • Change the width of a field using XML

    Hi,
    I customize a report -set the width of a field- using XML but my
    data is truncated.
    Is it posible to set vertical elasticity for this field using
    XML?
    My XML file is:
    <?xml version="1.0"?>
    <report name="Rep" DTDVersion="1.0">
    <layout>
    <section name="main">
    <field name="F_1" source="CP_FIELD" textColor="red" width="0.5"/>
    <field name="F_2" source="CP_FIELD" width="0.5"
    alignment="center"/>
    <field name="F_3" source="CP_FIELD" width="1"/>
    </section>
    </layout>
    </report>
    I will appreciate any suggestion.
    Thank you

    You can change the size of the label, the text input box, and the field itself (border around the field in the design tab) - however there is one exception to being able to control the size of every field individually:
    Fields that have "Labels left" or "Labels right" that are also the first field in a row will all share the same label width.
    This is probably what you are encountering, this is how the fields work for now, those first in a row label left/right labels are all the same width.
    Thanks,
    Josh

  • How to write a procedure to load the data into a table using xml file as input to the procedure?

    Hi,
    Iam new to the xml,
    can u please anyone help me how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me.
    <?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>.
    Regards,
    vikram.

    here is the your XML parse in 11g :
    select *
      from xmltable('//Entity' passing xmltype
    '<?xml version="1.0"?>
    <DiseaseCodes>
    <Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    <Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity>
    </DiseaseCodes>
    ') columns
      "dcode" varchar2(4000) path '/Entity/dcode',
      "ddesc" varchar2(4000) path '/Entity/ddesc',
      "reauthflag" varchar2(4000) path '/Entity/reauthflag'
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    Using this parser you can create procedure as
    SQL> create or replace procedure myXMLParse(x clob) as
      2  begin
      3    insert into MyXmlTable
      4      select *
      5        from xmltable('//Entity' passing xmltype(x) columns "dcode"
      6                      varchar2(4000) path '/Entity/dcode',
      7                      "ddesc" varchar2(4000) path '/Entity/ddesc',
      8                      "reauthflag" varchar2(4000) path '/Entity/reauthflag');
      9    commit;
    10  end;
    11 
    12  /
    Procedure created
    SQL>
    SQL>
    SQL> exec myXMLParse('<?xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>');
    PL/SQL procedure successfully completed
    SQL> select * from MYXMLTABLE;
    dcode                                                                            ddesc                                                                            reauthflag
    0                                                                                (I87)Other disorders of veins - postphlebitic syndrome                           0
    0                                                                                (J04)Acute laryngitis and tracheitis                                             0
    0                                                                                (J17*)Pneumonia in other diseases - whooping cough                               0
    SQL>
    SQL>
    Ramin Hashimzade

  • How to enable the EL in jsp page

    hi can u tell 'how to enable the EL in jsp page'?

    *I am getting below exception in tomcat when i inclued +<%@ page isScriptingEnabled="true" isELEnabled="true"%>+*
    org.apache.jasper.JasperException: /index.jsp(1,1) Page directive has invalid attribute: isScriptingEnabled
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
         org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:311)
         org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:106)
         org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2388)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2394)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Validator.validate(Validator.java:1700)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • How to halt the execution of JSP page..

    Hello all,
    I want to halt the execution of JSP page suppose for 10 seconds
    can anyone tell me how to do this
    Thanks
    Uttam

    ok
    thanks
    but this code will refresh the page after every 10 seconds.
    what i want that when click on a button on a page it will wait for 10 seconds
    then it should get refreshed only once i mean whenever i click on button
    not in ever 10 seconds
    thanks
    Uttam

  • Help needed on designing the structure of a flash game

    Hi,
    I am studying the codes from http://www.emanueleferonato.com/2009/01/16/designing-the-structure-of-a-flash-game-as3-ver sion-part-3/. What I don't get is at level_selection.as. Where does main_menu_button come from? I can't find where it has been created. I only see main_menu, not main_menu_button.
    Please help.

    The codes in level_selection.as looks like this, but the problem is I cannot find main_menu_button anywhere, except for main_menu.
    package {
        import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.display.SimpleButton;
        public class level_selection extends Sprite {
            public var main_class:the_game;
            private var level_thumb:level_thumbnail;
            public function level_selection(passed_class:the_game) {
                main_class = passed_class;
                for (var i:int = 1; i<=5; i++) {
                    level_thumb = new level_thumbnail(i,main_class);
                    addChild(level_thumb);
                main_menu_button.addEventListener(MouseEvent.CLICK, on_main_menu_button_clicked);
            public function on_main_menu_button_clicked(event:MouseEvent) {
                main_class.show_splash();

Maybe you are looking for