Parsing of text in JSP

hai, I am new to java and I wanna know how can i parse a text using StringTokenizer and then add them all(integers). I tried this but doesnt work.plz help.
<% int sum[];
try{
if(request.getParameter("result").indexOf("+")>=0){
StringTokenizer st=new StringTokenizer(request.getParameter("result"), "+");
while(st.hasMoreTokens()){
sum=Integer.parseInt(st.nextElement());
}}catch(Exception e){}
%>
appreciate ur help
qs

Hi
Since you are using '+' as a delimiter my guess is that in your request URL you have gien: '?result=19+10'
The problem with this is that the browser formats data that it sends to a server from a form in a similar fashion in that it puts a '+' for a blank space between values, So when the server interprets this it takes the '+' and inserts a blank space betweeen the values so if you provide result=8+9 then the servlet receives 8 9.....This gives you a NumberFormatException when trying to parse the Token. Instead try giving :
http://server-name:port-number/servlet-name?result=19,10
and in your servlet code put:
StringTokenizer tokens = new StringTokenizer(param,",");
This should work...
Keep me posted on your progress.
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems Inc.
http://www.sun.com/developers/support

Similar Messages

  • Parsing "HTML" text for AttributedString

    Well basically im writing a little instant messaging application where one user can speak to another.
    At the moment i have everything working fine, but now i want to move onto the next step. Using tags to create effects, i want to base my system on HTML since it's simple enough for people to follow and im comfortable using it.
    So anyway, im attempting to write a class which parses the text and then turns it into a java.text.AttributedString object.
    However, im stuck, i could write a class which would parse the commands (hopefully) and append the start and end of the command to the attributedstring while removing the tags as it goes along.
    But i can't think of a way to make it so that you can parse multiple commands and for example, with colour, you might have a large number or a small number so there is no definate size.
    If anyone could help me out with this i would be very gratefull and satisfied.
    Thank you for any help.

    i_own_pking wrote:
    But i can't think of a way to make it so that you can parse multiple commands and for example, with colour, you might have a large number or a small number so there is no definate size.First option that came to mind would be to split up the user's input by tags so you separate the tags from the text:
    <b><font color=red>This would be bold red font</font> whereas </b> this is <i>italicized</i>.
    Becomes:
    <b>    <font color=red>    This would be bold red font    </font>   whereas     </b>     this is    <i>    italicized    </i>    .Then you can put each segment into a tree, with each tag starting a new level in a tree (lets see if I can represent this visually):
    Root
       - <b>
          - <font color=red>
             - This would be bold red font
          - </font>
          - whereas
       - </b>
       - this is
       - <i>
          - italicized
       - </i>
       - .Then you could just do an in-order traversal of the tree, checking to see what html tag each node is, and applying it to all the leafs below that node (notice whereas is still below bold, but same level as the font, so the font color doesn't apply to it but the bold does, since it is a leaf below the node for bold).
    Edited by: bogdana on Jan 23, 2010 11:20 AM
    (messed up the grouping of the visual representation; fixed)

  • Parse A Variable From JSP to JSP

    hi all,
    how can i parse a variable from jsp page to another jsp page. i do not call jsp page . so how can i do this

    do u mean passing???
    try scope application

  • How to parse a text on a transition with OCL? is it possible ?

    Hi Everyone,
    I was just wondering if it is possible to put constraints between a transition on a state machine and a variable/attribute in a class diagram ? for example, to make sure if the user writes [X++] as a guard for a transition in state machine, the X attribute exists in the corresponding class diagram.
    Is it even possible with OCL? I think maybe it should be coded to parse the text... Any idea will be appreciated
    Thanks,
    Parsa

    Hi
    For OMG OCL, yes, since the capability is implied by the UML
    specification. However there are gaping chasms between the UML and OCL
    specifications, so any useable implementation relies on vendor intuition.
    For the new pivot-based Eclipse OCL, quite possibly. The UML support is
    primarily for Class Diagram elements, but is kind of extensible in so
    far as for unsupported UML elements, 'self' is aligned to the nearest
    containing Class. This works for statemachines, and could work for
    transitions. Activity diagrams are known to not work.
    Regards
    Ed Willink
    On 29/06/2015 18:02, Parsa Pourali wrote:
    > Hi Everyone,
    >
    > I was just wondering if it is possible to put constraints between a
    > transition on a state machine and a variable/attribute in a class
    > diagram ? for example, to make sure if the user writes [X++] as a
    > guard for a transition in state machine, the X attribute exists in the
    > corresponding class diagram.
    >
    > Is it even possible with OCL? I think maybe it should be coded to
    > parse the text... Any idea will be appreciated :)
    >
    > Thanks,
    > Parsa

  • VBScript for parsing multiple text files

    Hi,
    I have around 175 text files that contain inventory information that I am trying to parse into an Excel file. We are upgrading our Office platform from 2003 to 2010 and my boss wants to know which machines will have trouble supporting it. I found a script
    that will parse a single text file based upon ":" as the delimiter and I'm having trouble figuring out how to change it to open an entire folder of text files and write all of the data to a single Excel spreadsheet. Here is an example of the text
    file I'll be parsing. I'm interested in the "Memory and Processor Information" and "Disk Drive Information" sections mainly.
    ABEHRENS-XP Computer Inventory
    OS Information
    OS Details
    Caption: Microsoft Windows XP Professional
    Description:
    InstallDate: 20070404123855.000000-240
    Name: Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1
    Organization: Your Mom
    OSProductSuite:
    RegisteredUser: Bob
    SerialNumber: 55274-640-3763826-23029
    ServicePackMajorVersion: 3
    ServicePackMinorVersion: 0
    Version: 5.1.2600
    WindowsDirectory: C:\WINDOWS
    Memory and Processor Information
    504MB Total memory HOW CAN I PULL THIS WITHOUT ":" ALSO
    Computer Model: HP d330 uT(DG291A)
    Processor:               Intel(R) Pentium(R) 4 CPU 2.66GHz
    Disk Drive Information
    27712MB Free Disk Space ANY WAY TO PULL THIS WITHOUT ":"
    38162MB Total Disk Space
    Installed Software
    Here is the start of the script I have so far. . .
    Const ForReading = 1
    Set objDict = CreateObject("Scripting.Dictionary")
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.OpenTextFile("C:\Test\test.txt" ,ForReading)
    WANT THIS TO BE C:\Test
    Do Until objTextFile.AtEndOfStream
    strLine = objTextFile.ReadLine
    If Instr(strLine,":") Then
    arrSplit = Split(strLine,":") IS ":" THE BEST DELIMITER TO USE?
    strField = arrSplit(0)
    strValue = arrSplit(1)
    If Not objDict.Exists(strField) Then
    objDict.Add strField,strValue
    Else
    objDict.Item(strField) = objDict.Item(strField) & "||" & strValue
    End If
    End If
    Loop
    objTextFile.Close
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Visible = True
    objExcel.Workbooks.Add
    intColumn = 1
    For Each strItem In objDict.Keys
    objExcel.Cells(1,intColumn) = strItem
    intColumn = intColumn + 1
    Next
    intColumn = 1
    For Each strItem In objDict.Items
    arrValues = Split(strItem,"||")
    intRow = 1
    For Each strValue In arrValues
    intRow = intRow + 1
    objExcel.Cells(intRow,intColumn) = strValue
    Next
    intColumn = intColumn + 1
    Next
    Thank you for any help.

    You are The Bomb.com! I had to play around with it to pull some additional data (model and processor) and then write a quick macro to remove the unwanted text and finally I wanted the data to write in columns instead of rows so this is what I ended up with:
    Option Explicit
    Dim objFSO, objFolder, strFolder, objFile
    Dim objReadFile, strLine, objExcel, objSheet
    Dim intCol, strExcelPath
    Const ForReading = 1
    strFolder = "c:\Test"
    strExcelPath = "c:\Test\Inventory.xlsx"
    Set objExcel = CreateObject("Excel.Application")
    objExcel.Workbooks.Add
    Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)
    intCol = 0
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.GetFolder(strFolder)
    For Each objFile In objFolder.Files
      intCol = intCol + 1
      Set objReadFile = objFSO.OpenTextFile(objFile.Path, ForReading)
      Do Until objReadFile.AtEndOfStream
        strLine = objReadFile.ReadLine
        If (InStr(strLine, "Computer Inventory") > 0) Then
          objSheet.Cells(intCol, 1).Value = Left(strLine, InStr(strLine, "Computer Inventory") - 2)
        End If
        If (InStr(strLine, "Total memory") > 0) Then
          objSheet.Cells(intCol, 2).Value = Left(strLine, InStr(strLine, "Total memory") - 2)
        End If
        If (InStr(strLine, "Computer Model:") > 0) Then
          objSheet.Cells(intCol, 3).Value = (strLine)
        End If
        If (InStr(strLine, "Processor:") > 0) Then
          objSheet.Cells(intCol, 4).Value = (strLine)
        End If
        If (InStr(strLine, "Total Disk Space") > 0) Then
          objSheet.Cells(intCol, 5).Value = Left(strLine, InStr(strLine, "Total Disk Space") - 2)
        End If
        If (InStr(strLine, "Free Disk Space") > 0) Then
          objSheet.Cells(intCol, 6).Value = Left(strLine, InStr(strLine, "Free Disk Space") - 2)
        End If
      Loop
    Next
    objExcel.ActiveWorkbook.SaveAs strExcelPath
    objExcel.ActiveWorkbook.Close
    objExcel.Quit
    Thanks again!
    Hi ,
    I am have very basic knowledge about VB scripting, but this code could be the perfect solution i am looking for. could you guide me exactly how to run and test the same , i would be really thankful for your kind and generous support on this.
    Thanks ,
    Veer

  • Parse file text file

    Hi,
    I like read Apache error log using external table.
    For this I did create directory APACHE_LOG and grant read permission to it for my schema.
    Then external table
    CREATE TABLE EXT_APACHE_ERROR_LOG
        "TEXT" VARCHAR2(2000 BYTE)
      ORGANIZATION EXTERNAL
        TYPE ORACLE_LOADER DEFAULT DIRECTORY "APACHE_LOG" ACCESS PARAMETERS ( records delimited BY newline nobadfile nodiscardfile nologfile ) LOCATION ( "APACHE_LOG":'error.log' )
      REJECT LIMIT UNLIMITED;Log format is like below
    [Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/testI have try read file using query
    SELECT REGEXP_SUBSTR(text, '[^\[]+(.*?)')      AS mesg_date,
      REGEXP_SUBSTR(text, '\[([a-z]*?)\]')         AS mesg_type,
      REGEXP_SUBSTR(text, '\[client ([0-9\.]*)\]') AS client,
      REGEXP_SUBSTR(text, '\] (.*)$')              AS mesg
    FROM ext_apache_error_log;Output it is not quite what I like have as I'm bad with regexp.
    I like have result in 4 columns like
    MESG_DATE               MESG_TYPE     CLIENT          MESG
    Wed Oct 11 14:32:52 2000     error          127.0.01     client denied by server configuration: /export/home/live/ap/htdocs/testSo I need bit help
    What is best method parse that log format?
    Can I have those 4 columns some way already to external table?
    Thanks advance
    Regards,
    Jari

    Hi,
    I just noticed that log have lines where is no data for third column (client).
    This query demonstrate situation
    WITH test_data AS
      (SELECT '[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test' text
      FROM dual
      UNION ALL
      SELECT '[Wed Oct 11 14:32:52 2000] [notice] SIGUSR1 received.  Doing graceful restart' text
      FROM dual
    SELECT REGEXP_replace(text, '^\[(.*?)\].*$', '\1')   AS mesg_date,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,2)               AS mesg_type,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,3)               AS client,
      REGEXP_replace(text, '^(\[.*?\]\s){3}(.*)$', '\2') AS mesg
    FROM test_data ;In case there is no client info whole line from file is in fourth column (mesg).
    What could be best way handle this case so that client column is null but only the message should shown in mesg column ?
    Thanks advance
    Regards,
    Jari
    Edited by: jarola on Aug 31, 2011 8:24 PM
    I did come to this query
    WITH test_data AS
      (SELECT '[Wed Oct 11 14:32:52 2000] [error] [client 127.0.0.1] client denied by server configuration: /export/home/live/ap/htdocs/test' text
      FROM dual
      UNION ALL
      SELECT '[Wed Oct 11 14:32:52 2000] [notice] SIGUSR1 received.  Doing graceful restart' text
      FROM dual
    SELECT TO_DATE(REGEXP_REPLACE(text, '^\[(.*?)\].*$', '\1'),'Dy Mon DD HH24:MI:SS YYYY', 'NLS_DATE_LANGUAGE = AMERICAN') AS mesg_date,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,2)                                                                                  AS mesg_type,
      REGEXP_SUBSTR(text, '\[(.*?)\]',1,3)                                                                                  AS client,
      REGEXP_REPLACE(REGEXP_REPLACE(text, '^(\[.*?\]\s){3}(.*)$','\2'), '^(\[.*?\]\s){2}(.*)$','\2')                        AS mesg
    FROM test_data ;It seems work. If somebody have better query please post.
    And also if there is in good way combine expression that remove opening bracket and closing bracket from MESG_TYPE and CLIENT columns.
    Thanks

  • Dynamic text in JSP's

    I have a web application that allows for text to be inserted dynamically into its pages via a content managment system.
    Within this text, we have a requirement to be able to put some custom tags. The problem with this is that because the text is inserted into the Jsp at runtime, this text is obviously never compiled and thus, the custom tags never get executed.
    Does anyone know of any way to compile this text at runtime, through accessing the Jsp compiler, or through the use of a tag ?

    Yeah, the text is inserted using a custom tag :
    <cms:insert id="1234" />
    And the inserted text is just html snippets, but there could be custom tags inside it, like <form:input> tags. These tags don't get executed. I was hoping to be able to be able to do something like invoking the jsp compiler on this text, perhaps inside the code for the <cms:insert> tag handler.

  • Help with parsing a text string in address book and moving it to 'related person' field

    I am wanting to make a little applescript that will go thru my contacts and find data in the NOTES field and parse it slightly and move it to another field.  (sorry if parsing isn't the right word here)
    The data to be found is a GPS coordinate with this EXACT format:
    <Lat:12.345678><Lon:-12.345678>
    ...the only thing different from this example is the digits, and the number of digits.
    What I want to end up doing is deleting this data from the NOTES field, but leaving any other data, (this part sounds difficult to do to, to me!)
    And moving it to a related person field with the label gps, and the coordinate now reading exactly:
    12.345678,-12.345678
    (FYI, you can copy/paste a coordinate like this very fast into the maps app on iPhone and locate it instantly)
    Thanks for the help on this
    If this is too complicated I can break up the process into steps.  I know how to do some of it, but not sure about the parsing, and then delete just part of the notes field...
    Thanks!

    Hi,
    This script work here, try it :
    tell application "Address Book"
        repeat with thisContact in (get people)
            set tNote to note of thisContact
            if tNote is not missing value and "<Lat:" is in tNote and "<Lon:" is in tNote then
                set {GPS_value, newNote} to my getGPS_coordinate(tNote)
                if newNote is not "" then -- no error
                    set gpsField to (related names of thisContact whose its label = "gps")
                    if gpsField is not {} then
                        set value of (item 1 of gpsField) to GPS_value
                    else -- field "gps" is empty
                        make new related name at end of related names of thisContact with properties {label:"gps", value:GPS_value}
                    end if
                    set note of thisContact to newNote
                end if
            end if
        end repeat
        save
    end tell
    on getGPS_coordinate(this_note)
        set oldTid to text item delimiters
        set {tLat, tLon, newNote} to {"", "", ""}
        try
            set text item delimiters to "<Lat:"
            set tLat to text item 2 of this_note
            set text item delimiters to "<Lon:"
            set tLon to text item 2 of this_note
            set text item delimiters to ">"
            set {tLat, tLon} to {text item 1 of tLat, text item 1 of tLon} -- get values (lat... and long...)
            set text item delimiters to "<Lat:" & tLat & "><Lon:" & tLon & ">"
            set this_note to text items of this_note
            set text item delimiters to " "
            set newNote to this_note as string -- delete GPS coordinate in this note
        end try
        set text item delimiters to oldTid
        return {tLat & "," & tLon, newNote}
    end getGPS_coordinate

  • Using a scanner to parse a text file

    Hi,
    I'm running into some difficulties using a pattern for my scanner (java.util.Scanner). I need to scan a text file which consists of records. Each record has a keyword and a value (like property files):
    Example:
    FACILITY=TEST
    LOT=1234567
    DEVICE=abcdefgNormally, every record will be ended by a carriage return and line feed. So what I did was using a scanner with cr/lf as delimiter. That worked fine for most records but there are some records which span several lines (with cr/lf at the end of each line), e.g.:
    MAP_XY.01.01=" Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20
    19/15 13/4 Y-3 34/24 22/13 11/2 Y-2 36/30 28/24 22
    21/12 10/4 2/0 Y-1 38/0 Y0 40/35 33/22 20/15 13/0 Y1 41
    40/32 30/8 6/-1 Y2 42/26 24/-2 Y3 42/-5 Y4 47/11 9
    8/3 1/-6 Y5 48/47 45/39 37/18 16/-7 Y6 49/8 6/-8 Y7 49
    47/8 6/4 2/-8 Y8 50/9 7/3 1/-9 Y9 51/11 9/-10 Y10 51
    50/33 31/-10 Y11 52/40 38/35 33/23 21/16 14/-11 Y12 52
    51/34 32/15 13/4 2/-11 Y13 53/40 38/35 33/-12 Y14 53
    52/35 33/27 25/18 16/13 11/9 7 5 2/0 -4/-12 Y15 53
    52/-12 Y16 53/22 20/-5 -7/-13 Y17 54/47 45/-7 -9/-13 Y18 54
    53/22 20 18/2 0/-13 Y19 55/16 14/13 11/-2 -4/-13 Y20 55
    53/41 39/35 33/-14 Y21 55/52 50/48 46/16 14/10 8/-2 -4
    -6/-14 Y22 54/33 31/7 5/4 2/0 -2/-9 -11/-13 Y23 55
    54/53 51/26 24/-2 -4/-13 Y24 55/15 13/-14 Y25 55 53
    52/-7 -9/-10 -12/-14 Y26 54/44 42/14 12/10 8/-4 -6
    -7/-10 -12/-13 Y27 55/52 50/23 20/16 14/-13 Y28 54
    53/12 10/-1 -3/-13 Y29 55/44 42/-13 Y30 55/15 13/10 8
    7/-13 Y31 55/17 15/-13 Y32 54/44 42/-1 -3/-13 Y33 54
    53/41 39/30 28/-13 Y34 54 52/37 35/19 17/12 9/8 5/3 1
    0/-4 -6 -9/-11 Y35 54/-13 Y36 54/35 33/31 29/13 11
    10/2 0/-2 -4/-13 Y37 54/-13 Y38 53/11 9/0 -2/-9 -11
    -12 Y39 53/35 33/31 29/-12 Y40 53/22 20/15 13/-12 Y41 52
    50/15 13/10 8/-11 Y42 52/11 9/5 3/-6 -8/-11 Y43 51
    50/41 39/10 8/0 -2/-10 Y44 51/28 26 24/15 13/12 10
    9/-10 Y45 50/43 41/32 30/4 2/-9 Y46 49/31 29/13 11
    10/-8 Y47 49/47 45/30 28/24 22/-8 Y48 48/42 40 38/12 10
    9/-7 Y49 47/42 40/38 36/-6 Y50 44/33 31/30 28/6 4/-5 Y51 44
    43/28 26/17 15/13 11/-2 Y52 44/32 30/-2 Y53 43/32 30
    29/13 11/-2 Y54 42/27 25/24 22/16 9 7/-1 Y55 41/21 19
    18/0 Y56 39/15 13/6 4 2 Y57 38/20 18/3 Y58 36/5 Y59 34
    33 31/30 28/7 Y60 31/28 26/10 Y61 27/14"
    BIN_COUNT.01.09=12345Using the following delimiter does not work
    fileScanner.useDelimiter("\\s*=\\s*");because the result would be something like:
    keyword: FACILITY     value: TEST
    LOTkeyword: 1234567
    DEVICE     value: abcdefgWhat I need is a pattern which also handles carriage return/line feed until a new keyword (like LOT for example) occurs.
    The correct result should be:
    keyword: FACILITY     value: TEST
    keyword: LOT            value: 1234567
    keyword: DEVICE     value: abcdefg
    keyword: MAP_XY.01.01 value: " Y-7 24/10 Y-6 24 22/17 15/7 Y-5 29/7 5 Y-4 32/22 20...
    {code}
    I hope, I did explain clearly enough...
    Any help would be appreciated.
    Thanks and best regards
    - Stephan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Any help would be appreciated.You have grouping and data in the groupings and you are attempting to parse it all at one go.
    Won't work. (Might in a perfect world but not in this one.)
    You need a parsers that do the following
    1. Parser text file (stream) into records.
    2. Parse records into data.
    You can put both into one class or not.
    Your record parser is going to be based roughly on the following scheme.
    1. Find keyword,
    2. Look up format defined for keyword
    3. Attempt to read format found.
    4. Error if format not found.
    5. Else return the record found.
    I say roughly because as noted above you need to know what the actual output looks like. It is possible to determine this if you have enough examples but it is a lot easier if you actually get the specification that tells you what it looks like.
    I suspect, but don't know that the "format" in the above will consist of the following.
    <word><text>
    or
    <word><text>
    <space><text>
    <space><text>
    You could just create one format for the all but you will likely have record types that don't fit that and the earlier you detect errors the better.

  • Error when parsing SOAP message from JSP

    i write a class to call SOAP message from a servlet on jdev 1013
    when i run the class alone it works fine
    soapMessage = this.buildSOAPMessagee();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    soapMessage.writeTo(output);
    SOAPConnectionFactory connf = SOAPConnectionFactory.newInstance();
    SOAPConnection conn = connf.createConnection();
    SOAPMessage smsg= conn.callsoapMessage, "http://190.0.0.16:8988/mmsc/httpReceiver");
    smsg.writeTo(out);
    but when running same class same method from jsp page...i have Exception
    javax.xml.soap.SOAPException: Unable to get header stream in saveChanges     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:576)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:622)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:686)     at oracle.j2ee.ws.saaj.soap.MessageImpl.writeTo(MessageImpl.java:702)     at test.test2.ret(test2.java:341)     at untitled1.jspService(_untitled1.java:45)     [untitled1.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: SOAP exception while trying to externalize: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:220)     at oracle.j2ee.ws.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:522)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:574)     ... 23 moreCaused by: javax.xml.soap.SOAPException: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:104)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:76)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:215)     ... 25 moreCaused by: oracle.xml.parser.v2.XMLParseException: Start of root element expected.     at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)     at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:333)     at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:295)     at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:78)     ... 27 more
    dose anybody can help why that happend when running the code from JSP

    i write a class to call SOAP message from a servlet on jdev 1013
    when i run the class alone it works fine
    soapMessage = this.buildSOAPMessagee();
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    soapMessage.writeTo(output);
    SOAPConnectionFactory connf = SOAPConnectionFactory.newInstance();
    SOAPConnection conn = connf.createConnection();
    SOAPMessage smsg= conn.callsoapMessage, "http://190.0.0.16:8988/mmsc/httpReceiver");
    smsg.writeTo(out);
    but when running same class same method from jsp page...i have Exception
    javax.xml.soap.SOAPException: Unable to get header stream in saveChanges     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:576)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:622)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:686)     at oracle.j2ee.ws.saaj.soap.MessageImpl.writeTo(MessageImpl.java:702)     at test.test2.ret(test2.java:341)     at untitled1.jspService(_untitled1.java:45)     [untitled1.jsp]     at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60)     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416)     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478)     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)     at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)     at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230)     at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33)     at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831)     at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298)     at java.lang.Thread.run(Thread.java:595)Caused by: java.io.IOException: SOAP exception while trying to externalize: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:220)     at oracle.j2ee.ws.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:522)     at oracle.j2ee.ws.saaj.soap.MessageImpl.saveChangesMimeEncoded(MessageImpl.java:574)     ... 23 moreCaused by: javax.xml.soap.SOAPException: Error parsing envelope: (1, 1) Start of root element expected.     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:104)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:76)     at oracle.j2ee.ws.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:215)     ... 25 moreCaused by: oracle.xml.parser.v2.XMLParseException: Start of root element expected.     at oracle.xml.parser.v2.XMLError.flushErrors1(XMLError.java:320)     at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:333)     at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:295)     at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:201)     at oracle.j2ee.ws.saaj.soap.soap11.SOAPImplementation11.createEnvelope(SOAPImplementation11.java:78)     ... 27 more
    dose anybody can help why that happend when running the code from JSP

  • Displaying arabic text in jsp page

    Hi,
    Iam displaying some arabic values which will come from server in my jsp page.
    but the problem when display the values its showing rubbish like �������������
    when i select the view-->encoding from browser its showing arabic values..
    i set <meta http-equiv="Content-Type" content="text/html; charset=windows-1256"> like this in my jsp page..
    When i put the arabic text in normal .html page its working fine its displaying fine..
    when iam calling jsp page iam getting above problem..
    do i need to make any setting in server..iam using j2ee refrence server..
    Regards,

    use UTF-8 for character encoding then arabic text will display

  • Parsing a text

    Hi there!
    Does somebody can tell me how can I “parse” the
    content of a variable (html text) to multiple movieclip/textfields.
    I unsuccessfully tried to with bottomScroll and maxScroll...
    Many thanks in advance for any help!

    Hello ewon15!
    Thanks for responding.
    A brief survey of the operations:
    On my site users perform searches
    (Flash-->PHP-->MySQL).
    Results are most often html lists or texts.
    They are displayed in scrollable dynamic text fields.
    And, most often, result displayed is only a part of the total
    result.
    The total result often exceeds the dimensions of a printed
    page.
    At the moment, I send the variable value (the "total result")
    to a built-in movie clip named PRINTMC which contains a dynamic
    text field named printFld.
    PRINTMC contains:
    first frame label "#p" and printFld, stop();
    second frame "#b" and a 600x800 bounding box
    I have also built two other movie clips named PRINTMCTWO and
    PRINTMCTHREE identicals to PRINTMC and ready to receive, if
    necessary, the continuation of what will be printed on the first
    page.
    Of course I only get printed, at the moment, the first part
    of the total result.
    The part which fits the page.
    The problem is:
    How to parse myPrintStr (see attached code) to have it
    printed in full ?

  • Please recommend a  tool or framework that parsing delimited text to XML

    Working on a project that need me read data from delimited text file, the data will be converted to a tree-structure. So it's better parse the data into XML format first.
    Besides j2se or jdom, any fast tool for it?
    Thank you

    alex888 wrote:
    Working on a project that need me read data from delimited text file, the data will be converted to a tree-structure. So it's better parse the data into XML format first.What??? Why? You've got a text file and need an object tree, why do you think going to XML in between is a good idea?
    Besides j2se or jdom, any fast tool for it?What do you mean with "j2se", that's not a XML handling tool (it contains several, 'though).
    SAX sounds good for building object trees from XML, but there are several XML mapping libraries out there (try google).

  • Need help Loading parsed RSS text

    Hi, I have created an AS3 FLA where I am parsing and
    displaying RSS text. I have traced the parsed text and displayed
    the text into dynamic text boxes on the stage no problem.
    However the line breaks in the traced text show up on stage
    as well.
    How does one strip out the <p> or </r> tags from
    the text to make the text one nice long line that will wrap using
    the length of the text box as it's parameters?

    OK, I have found the answer, thanks all.
    var myvar:String = myDynamicText.text;
    myDynamicText.text = myvar.split("\r").join(" ");
    myDynamicText.text = myDynamicText.text.split("\n").join("

  • Remove HTML Tags and parse the text out of it

    Hi All -
    I had a text file with all the HTML Tags on it. I want to parse text out of it. Is there any package available to remove all the HTML Tags from the text.
    For example
    <HTML><BODY bgColor=#ffffff> This is the text i want to parse.</BODY></HTML>
    The result would be: This is the text I want to parse.
    The text can be very long and can have many different HTML Tags. I cannot use REPLACE becuase tags can me lot more then I thought.
    Please respond as soon as possible..Thanks for all your help!!
    Anuj Sharma

    thank you all, but my code is only html no xml , and is other application that save in table
    <html><head><title>Aprovação de ARC</title></head><body><font face=arial size=2><b>974-17016/ugadiego-2013</b></font><br><br><table border=0><tr><td><b><font face=arial size=1>Data da Abertura</font></b></td>    <td><font face=arial size=1>8/3/2013</font></td><tr><td><b><font face=arial size=1>Quebra Produtividade</font></b></td>    <td><font face=arial size=1>Sim</font></td><tr><td><b><font face=arial size=1>Quantidade</font></b></td>    <td><font face=arial size=1>17,5</font></td><tr><td><b><font face=arial size=1>Valor</font></b></td>    <td><font face=arial size=1>R$ 17496</font></td><tr><td><b><font face=arial size=1>Forma de Indenização</font></b></td>    <td><font face=arial size=1>Nota de Crédito</font></td><tr><td><b><font face=arial size=1>Observação</font></b></td>    <td><font face=arial size=1>Evidenciado a não conformidade do produto em visita a cliente pela assessoria agronômica e qualidade.
    Produto apresenta-se empedrado com desuniformidade de grânulos e por consequência geração de finos e falha de óleo.
    Produto expedido com GDAP.
    Bonificar o cliente em 10% do valor da compra = R$ 17.496,00 ou em toneladas e fertilizantes  que podem ficar em forma de crédito para o cliente retirar em fertilizante para o plantio  da soja. Conforme relatório do Sr. Ademilson Palharin em anexo.</font></td><tr><td><b><font face=arial size=1>Centro de Custo</font></b></td>    <td><font face=arial size=1>CAS1I4671 - MISTURA E ENSAQUE I                     </font></td></table><hr><font face=arial size=2><b>Favor incluir uma Observação (Se necessário) e selecionar o botão desejado para aprovar ou reprovar essa Indenização.</b></font><FORM ACTION='http://10.176.10.123/pgAprovaARCServidor.asp' METHOD='GET' ><font face=arial size=2><div>Observações:</div><textarea name='txtObs' rows='4' cols='60' maxlength='4000'></textarea><br><br><div><input type='submit' value='Aprovar'  name='acao'> <input type='submit' value='Reprovar' name='acao'></div></font><br><hr><font face=arial size=2 >Essa é uma mensagem automática.<br>Favor não responder esse email</font><hr><input type='hidden' name='cdARC' value='17016' ><input type='hidden' name='cdSeq' value='1' ><input type='hidden' name='cdFase' value='Indenizacao' ><input type='hidden' name='dsResp' value='ustrenat' ><input type='hidden' name='dsCargo' value='Vice Presidência' ><input type='hidden' name='dsSolic' value='LESIANE CIESLAK' ><input type='hidden' name='index' value='3' ><input type='hidden' name='rowatu' value='3' ></FORM></body></html>using oracle 9.2.08
    Edited by: muttleychess on Mar 19, 2013 11:36 AM

Maybe you are looking for