HTML source from database

Hi all,
I am putting up all the button text, label text, and messages in the database. Then i call up a PL/SQL process onload of the page, and populate these labels and text dynamically. all worked fine till here.
Problem arised when i keep a message,
<bold tag> Some Information <end bold tag>
(where bold tag means b, and end bold tag means \b) as i dont know how to place bold tags here on forum.in the database. When this text is placed in an HTML region, it renders as it is "with the tags", is there any way we can remove the tags and place this text as it should render after the tags?
Many thanks,
Sunil Bhatia

Hi Sunil,
Make the region a PL/SQL anonymous block then use the HTP.print() command to output to screen. e.g. I have a record &lt;b>Hi&lt;/b> in my database (with the tags). and the following code:
DECLARE
     cursor cur is select field from HTML_TEST;
     msg varchar2(400);
BEGIN
     for c in cur  loop
          msg := c.field;
     end loop;
     HTP.print(msg);
end;It prints out the value with the formatting in place (<b>Hi</b>). My test was simple (one column with 1 row) but I'm sure the same can be applied to your idea.
Mike
Edited by: Dird on 06-Aug-2009 03:34

Similar Messages

  • Selecting html source from the text pane

    Help!!
    I am selecting text in the HTMLEditor text pane but when I look at the selected text it does not include tags like image and table tags. I would like to somehow grab the selected html source based on what is selected in the text pane. Is there a way to map the selected text in the editor textpane to the html in the editor sourcepane? I have not been able to find an answer in previous threads.
    thanks,
    Steve

    here is the easiest way i know
    using JEditorPane from the swing package
    JEditorPane sourceViewer = new JEditorPane(http://www.google.com);
    System.out.println(sourceViewer.getText());
    or
    JTextArea.setText(sourceViewer.getText);
    several things to concider....
    1. you dont have to add the component to abuse it, ie you dont have to show the JEditorPane you can just use its functionality
    2. you cant JUST display the text in anything made to display html unless you removed the <html> tag. but that wont stop you from printing it or putting it into a JTextArea

  • Get HTML source from servlet or strut action

    Hi, need ur help
    I would like to get the HTML source code after calling a URL, for example,
    Suppose a servlet will return a page hello.html, i would like to grap this HTML page source code in my servlet or strut action.
    How can i achieve this?
    Thanks

    This question does not make sense, because the Servlet is the thing that generates the HTML in the first place.
    If you want to view the HTML source of a given web page. Go to 'View'->'Source' in Internet Explorer.

  • How to get the html source for these web page ?

    My code work well for standart page, but I'm unable to get the html source from these page with my vb program :
    http://www.slashdot.org
    http://userfriendly.org
    http://segfault.org
    here my code
    private sub commandgethtml_Click ()
    Inet1.Cancel
    Inet1.Protocol = icHTTP
    Inet1.URL = theURL
    HTMLcode = Inet1.OpenURL(theURL, icString)
    RichTextBox1.Text = HTMLcode
    end sub
    thanks in advance.

    Hello Cyrano,
    This Developer Forum focuses on the National Instruments product "Measurement Studio for Visual Basic" (formerly known as ComponentWorks). Our goal is to help people to better integrate this product into their test, measurement, and automation applications. Your question directly pertains to the Microsoft Internet Transfer Control. I think you would find an increased number of responses that are better focused on your question if you would repost it to a forum that specializes in general VB and internet programming. Good luck!
    Jeremiah Cox
    Applications Engineer
    National Instruments
    http://www.ni.com/ask

  • Retreiving HTML data from an URL

    It is possible to get HTML data (HTML source) from Java (text), and store them in a string ? Using java application (no gui).

    import java.net.*;
    import java.io.*;
    public class GetHTML
         public static void main(String[] args)
                    if (args.length < 1)
                   System.out.println("Usage: <URL>");
                   return;
                    try{
              URL url = new URL(args[0]);
                    BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
                    String line = "";
                    while ((line = in.readLine()) != null)
                        System.out.println(line);
                    }catch(MalformedURLException mue){
                        System.err.println("Bad URL: " + mue);
                        return;
                    catch(IOException ioe){

  • Command to  provide list of all objects and their scripts from database

    Hi,
    How do i get the list of all objects and their scripts/source from database?
    I guess using dbms_metadata package or Toad tool we can achieve the above task
    But i do not know the steps to get the objects and their scripts.
    Im using oracle database 11g R2 11.2.0.2
    Kindly ge me the advice
    Thanks in Advance

    How do i get the list of all objects and their scripts/source from database?
    I guess using dbms_metadata package or Toad tool we can achieve the above task
    But i do not know the steps to get the objects and their scripts.
    Im using oracle database 11g R2 11.2.0.2If you want the all the metadata of whole database, then it is quiet difficult to get from DBMS_METADATA, as it is very complex because you need to gather for each object of each schema in whole database and to spool.
    http://www.orafaq.com/node/57
    I want to know, what is the use of entire database metadata, Certainly need of objects of metadata.
    or if you want to whole database, then i suggest you go for export full backup and import as impdp sqlfile option,

  • Best way to retrieve page source from a webserver using a fixed schedule??

    Right now I have a working program that will get the html source from a webserver, parse it and format to a more readable format. (In the future I would like to send a message with its content to a cellphone). But for now I would just like to know the best way to keep the connection object alive, while being able to call a GET request for the source (without having to create a new object everytime), in this case it is the bufferedreader. (The getSource() method is called in a thread every minute.
    What would be the best way to achieve this?
    Here is a snippet of the code for the web class.
    public class cWeb {
    static {
    try {
    myUrl = new URL("http://xxx.xxx.xxx/index.html");
    catch (MalformedURLException murle){
    System.out.println(murle.getMessage());
    catch (IOException ioe){}
    public static void getSource()
    String inputLine = null;
    pageSource = null; // this is a global var used in parse
    try {
    BufferedReader in = new BufferedReader(
    new InputStreamReader(
    myUrl.openConnection().getInputStream()));
    while ((inputLine = in.readLine()) != null)
    pageSource += inputLine;
    in.close();
    catch (MalformedURLException murle){}
    catch (IOException ioe){}
    }

    Hi,
    The data can be passed using URL parameters.
    In NW04s, Web Dynpro provides "Suspend" and "Resume" plugs for transferring the control to Non-WebDynpro framework and back to Web Dynpro application.
    1. Define an outbound plug of type suspend in the interface view
    -Suspend plug automatically generates a parameter with the name URL of type string
    2. Define a method (e.g. onActionSuspend) in the view controller, set return type void
    3. Define an action in the view controller (e.g. suspend, the event handler is onActionSuspend)
    4.Create the URL‘
    URL = newString(URLofTheExternalFrameworkapplication+ paramsString)
    5.Implement the FirePlug
    wdThis.wdGetTopLevelComponentInterfaceViewController().wdFirePlugSuspend(URL);
    6.Define an inbound plug of type resume in interface view.
    public void onPlugResumePlug{
    String resumepara=
    WDWebContextAdapter.getWebContext.getRequestParamet
    er/“param1“);
    From the non-WD framework,
    1. you have to get the currentURL
    String wdUrl= getCurrentUrl();
    2. Decode the URL
    try{
    wdUrl= URLDecoder.decode(wdUrl,“ISO-8859-1“);
    3.Then you can build the URL by appending URL params
    wdResumeUrl= wdUrl+ 'param1=' + result + 'param2'
    4. invoke it, the WD application would be resumed without getting timed out.
    If you don't have plugs of type Suspend and Resume in interface view in your IDE, then it maybe in the later versions of NW04s.
    Hope this helps.
    Thanks and Regards,
    Rohit Jaiswal

  • Jasper report on HTML when one image loaded from database and for the other

    How to generate jasper report on HTML when one image loaded from database and for the other we give a image path
    My code
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
              exporter = new JRHtmlExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, baos);
              exporter.setParameter(JRHtmlExporterParameter.IMAGES_URI, strImageInputDirectory);
         exporter.setParameter(JRHtmlExporterParameter.IMAGES_DIR_NAME, strImageOutputPath == null ? "." : strImageOutputPath);
         exporter.setParameter(JRHtmlExporterParameter.IS_OUTPUT_IMAGES_TO_DIR, Boolean.TRUE);
         exporter.setParameter(JRHtmlExporterParameter.IS_USING_IMAGES_TO_ALIGN, Boolean.FALSE);
         exporter.setParameter(JRHtmlExporterParameter.IS_WHITE_PAGE_BACKGROUND, Boolean.FALSE);
              exporter.exportReport();
              byte[] bdata = ((ByteArrayOutputStream) baos).toByteArray();
    Can any one help pls
    Message was edited by:
    ameet.au

    hey sorry for posting it in this forum.
    but do u have sample code for making it work.. since i am able to do it on PDF format(image from Database and another stored in the webserver) using
    byte image[] =(byte[]) outData.get("image");
                        ByteArrayInputStream img = new ByteArrayInputStream(image);
                        hmimg.put("P_PARAMV3", img);
    print = JasperFillManager.fillReport(reportFileName, hmimg, jrxmlds);
    bdata= JasperExportManager.exportReportToPdf(print);

  • How to get the HTML Source code from the active browser ?

    Hi All,
    I need to get the HTML Source code from the active browser (IE). I tried with the below code, but I am not able to get the Source code all the time, with respect to the different applications (http or https) and the user authentication has to be changes in few applications (_I dont know or not able to given that in the below code_). More over there is also a dependence of the URL to get the HTML Source code.
    Therefore what I feel is getting the HTML Source code from the given or active browser will be consistent than the URL. Since the Source code is available in the browser (IE) . Please help me with a sample code to achieve this . . . !
    HTMLDocument doc=(HTMLDocument) kit.createDefaultDocument();
    doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
    URL url = new URL(strURL);
    Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
    kit.read(HTMLReader, doc, 0);Thanks in advance,
    Regards,
    Jothi Venkatachalam
    Edited by: j0o on May 7, 2009 3:11 AM

    The simple answer is: you don't.
    Not only is it simply not possible, but the entire concept of "the active browser" doesn't exist.
    You were on the right track with your code to retrieve the page directly from the server, but as you noticed that code will only work for regular http connections.
    For https and other protocols you will need to use appropriate libraries for each protocol. Something like Apache Commons can help you with that. There are networking libraries in there for a lot of commonly used protocols.

  • Error 1901. Error attempting to read from the source installation database

    OS: Windows 7 Enterprise 64-bit
    Browsers: IE 9 and Firefox 10
    Flash Version 11.7.700.169
    I'm logged in as Administrator.  I'm trying to install using this:
    start "" /wait msiexec /i install_flash_player_11_active_x.msi /qb
    and
    start "" /wait msiexec /i install_flash_player_11_plugin.msi /qb
    Both commands result in:
    Error 1901. Error attempting to read from the source installation database: C:\Windows\Installer\3c0cc1.msi
    (the file name seems to be random)
    echo %errorlevel% returns 1603.
    Help.

    Not sure how much I can help you with this.  Error 1603 usually indicates that the installer cannot proceed because something is in use; search this page for 1603: http://msdn.microsoft.com/en-us/library/windows/desktop/aa372835%28v=vs.85%29.aspx

  • JavaCompiler - Compiling source from a database

    Dear all,
    I managed to compile some code on the fly using the javax.Tool package as shown underneath:
    import javax.tools.*;
    class CompilerExample {
        public static void main(String[] args) {
            String fileToCompile = "Program.java";
            JavaCompiler compiler =  ToolProvider.getSystemJavaCompiler();
            int compilationResult = compiler.run(null, null, null, fileToCompile);
            if (compilationResult == 0) {
                System.out.println("Compilation is successful");
            } else {
                System.out.println("Compilation Failed");
    }However I'd like to get my code from a database rather than from a file. I know that the run method has an argument (the first) of type InputStream. I tried reading the stream but couldn't manage. Any hints please?
    package compiler;
    import javax.tools.*;
    import java.sql.*;
    import subpack.Data;
    import java.io.*;
    public class Main {
        public static void main(String[] args) throws Exception {
            Connection con = null;    
            PreparedStatement ps = null;
            ResultSet rs = null;
            try{
                Class.forName(Data.driver).newInstance();
                con = DriverManager.getConnection(Data.url + Data.db, Data.user, Data.pass);
            } catch (Exception e){
                System.out.println(e);
            ps = con.prepareStatement("SELECT source FROM source WHERE id = 156");
            rs = ps.executeQuery();
            while (rs.next()){
                InputStream in = rs.getBinaryStream("source");
                JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
                int compilationResult = compiler.run(in , null, null, "");
                if (compilationResult == 0) {
                    System.out.println("Compilation is successful");
                } else {
                    System.out.println("Compilation Failed");
    }Thanks

    I found some source code to compile code in memory and converted it into something I needed. Here goes:
    package compiler;
    import java.net.URI;
    import java.util.Arrays;
    import javax.tools.JavaCompiler.CompilationTask;
    import javax.tools.JavaFileObject.Kind;
    import javax.tools.*;
    import java.sql.*;
    import subpack.Data;
    import java.io.*;
    import java.util.StringTokenizer;
    public class Main {
        public static void main(String[] args) throws Exception {
            Connection con = null;    
            PreparedStatement ps = null;
            ResultSet rs = null;
            try{
                Class.forName(Data.driver).newInstance();
                con = DriverManager.getConnection(Data.url + Data.db, Data.user, Data.pass);
            } catch (Exception e){
                System.out.println(e);
            ps = con.prepareStatement("SELECT source FROM source WHERE id = 156");
            rs = ps.executeQuery();
            if (rs.next()){
                String source = rs.getString("source");
                JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
                DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>();
                StringWriter writer = new StringWriter();
                PrintWriter out = new PrintWriter(writer);
                out.println(source);       
                out.close();
                StringTokenizer st = new StringTokenizer(source," ");
                String className = null;
                while (st.hasMoreTokens() && className == null){if (st.nextToken().equalsIgnoreCase("class")) className = st.nextToken(); }
                if (className.indexOf('{') > 0) className = className.replace('{', ' ');
                JavaFileObject file = new JavaSourceFromString(className.trim(), writer.toString());
                Iterable<? extends JavaFileObject> compilationUnits = Arrays.asList(file);
                CompilationTask task = compiler.getTask(null, null, diagnostics, null, null, compilationUnits);
                boolean success = task.call();
                if (success) {
                      System.out.println("Successful");
                } else {
                    for (Diagnostic diagnostic : diagnostics.getDiagnostics()) {
                      System.out.println(diagnostic.getMessage(null));
    class JavaSourceFromString extends SimpleJavaFileObject {
          final String code;
          JavaSourceFromString(String name, String code) {
            super(URI.create(name.replace('.','/') + Kind.SOURCE.extension),Kind.SOURCE);
                this.code = code;
          @Override
          public CharSequence getCharContent(boolean ignoreEncodingErrors) {
            return code;

  • How To Access PAGE ITEM (single row) from HTML source

    Hi Guys,
    I have a page Item that return a string.
    I would like to show this string
    How To Access PAGE ITEM (single row) from HTML source?
    My desire final output is
    <marquee>:P1_PAGE_ITEM</marquee>
    Can please help me
    Thanks

    Hi,
    You can refer the page items in your page header as &itemname. For example, if I have page item P15_TEST, I will add the following in header:
    <marquee>
       &P15_TEST.
    </marquee>But make sure that you have a process before header to populate the value in your page item. Otherwise, there will be a null scrolling (which you can't see!) :)
    Regards,
    Zahid

  • How do I set BI Publisher to read html tags from the database?

    How do I set BI Publisher (Release 10.1.3.4) to read html tags from the database? For example if the text is quoted with a bold tag I want my output to display the text in bold. Is there a setting or something I can set?

    I took a look at Tim Dexter's blog as suggested and the sample worked, but for the elements in the xml file not for the value coming from the database, however this is good to know as well!
    I have data in the data base column which looks like this:
    'MS Applied <B(bold tag)> Mathematics</B(bold tag)>University of Southern California'
    I want the data to be rendered like this:
    'MS Applied <B>Mathematics</B> University of Southern California'.
    In Report Builder on the property sheet I would set Contains HTML Tags property to Yes and the report would render correctly.
    In BI Publisher 10.1.3.4 I can not seem set it to read this I have change the configure properties of the report to Character set to HTML and Make HTML output accessible to True. I just can't figure out what I'm missing.
    Thank you for any assistance you can offer.

  • Where does the html source when using paramform=html generated from?

    I have changed my server name and I have found that when I have paramform=yes or html in the url for the report, the html source of the paramform that is displayed uses the old server name.
    Does anyone know where the paramform is generated from, or is it just a template?
    If the report does not require any parameters and I have paramform=no in the url, then it works correctly.

    Go to TextEdit preferences and set everything to Plain Text instead of Rich Text and make sure you check the box for "ignore rich text commands in html files".

  • Exporting data from a html format into database

    Hello:
    Maybe someone can help me. I wrote a Test Stand program and save the test results in the html format everyone liked be able to access the data thru a web page but now we want to save the data to a database witch I was able to do. I need import the files save in html to the database. Does any knows how to do this or at least convert into a .txt or .csv format

    Hey Toro,
    Unfortunately there is no utility that will parse your HTML format files into your DataBase. This is primarily because the report files don't have all the information that is stored in the database. The data stored in the database is quite complex. So you might have to resort to manually inserting the fields, although this process is quite tedious. Also you cannot really convert your HTML files into .csv file, just because once a report is created TestStand doesn't know what data fields of the HTML file is important or not.
    I'll place a product suggestion over to R&D to maybe look into creating a utility for our future releases.
    SijinK
    National Instruments

Maybe you are looking for