HTML code generation with Java

Hi, I don't know how pertinent it is to ask this question
whether we have java api anywhere to generate html code.

You can use any implementation of the xml api (jaxp)
do generate XML and the new versions of html are xml.
or you can use Java Server Pages and custom taglibraries like the struts framework for example.
It really depends on what you want to do exactly...
create a web application ... store documents as html ...
Spieler

Similar Messages

  • Read "Qualified Range Key Generation" with Java API.

    Hi guru,
    I use MDM 5.5 SP6.
    In MDM Console I read Qualified Range Key Generation it in "ADMIN -> Remote Systems -> Qualified Range".
    I have to get "Qualified Range Key Generation" with Java API.
    It's possible?

    Hi Rocco,
    I am also thinking  of same scenario.I thought it is possible in Java Apis by calling the webservices for MDM.there is a service of "get key mapping" where we can pass this "Qualified key range" as  parameter.In MDM we have to define a look up table for that key ranges .We will access that table through JAVA API and then link it with the key mapping service .
    If u find any solution to apply this ,please share.
    thanks and regards
    Ank

  • Import statement code generation from Java-Platform Model in Java Studio

    Problem : When you create a Java-Platform Model type project in Java Studio 8.1 and as an example You would like to create an Attribute with java.util.Date type for a Class than how can You set this Attribute type in order to create the Code Generator the standard java package reference in Your code like : "import java.util.Date;" ? What is the right syntax in the "Type'" field of the Attribute Properties dialog ?

    You should also consider using NetBeans as an alternative to JSE8.1.
    Java Studio Enterprise 8.1 is itself built on top of NetBeans version 5.0. NetBeans is an ide developed as opensource at www.netbeans.org; it is extensible ide and so add-on modules can be developed to run on top of netbeans. And that is what JSE8.1 does; JSE 8.1 is NetBeans 5.0 plus several add-on modules (like UML etc).
    The latest stable version of NetBeans is 6.0 and provides improved versions of all relevant addons found in JSE.
    Home page: www.netbeans.org
    Download: http://www.netbeans.info/downloads/index.php
    Docs: http://www.netbeans.org/kb/index.html
    Further community resources (mailing lists, issue tracking etc) : http://www.netbeans.org/community/index.html
    wiki.netbeans.org
    NetBeans download is free. And since it is developed as an opensource project, the source is freely available under CDDL license.

  • Code 'Generation' with DRY (don't repeat yourself)??

    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double secondMost of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    I would greatly appreciate some guidance on this, or pointed to more information.
    Thanks

    dajohnson1s wrote:
    Hello I am new to the forum so please be kind,
    I have recently gotten an internship with one of the offices with my University and am working a project (for a while now). I spend most of the day just getting all the classes assembled to be used (often a two day process) and what I would like to do is pass in a few parameters then have it generate the majority of the standard code that takes so much time to type out.
    What I am referring to is Consructors/ Setters/ Getters and toString.
    Parameters:
    Class name
    int first 5
    double second
    Most of this stuff is pretty standard, but I figured there was a template or something I could build to do much of this for me. Unfoturnaly the University teaches C++, so learning Java on my own is somewhat difficult at times.
    First step is recognizing a pattern.
    Second step, experience wise, is learning to recognize the difference between something that should be generated and something that shouldn't.
    Third step is implementation.
    Code generation should only be used if it can be insured that it eases the task now and in addition does not complicate the task in the future. That must include the possibility that the generation part will be abandoned so the generated code itself must be in such a state that it can be maintained.
    Once you have a pattern then you must choose a way to represent the pattern as a 'source'. Sources can one or more of the following: text, xml, sql scripts, sql databases, existing source files, existing code bases, design document, pdf files. Anything that you can extract a definition from will work.
    An example text file relevant to your task might look like this.
          Class: XxxMyclas
          Attribute: Count int
          Attribute: Name String.From that you create a standard compiler type idiom
    1. Parse (read file and collect data)
    2. Syntax (validate collected data, which might also be part of 1)
    3. Generate (use data to generate new source)
    Each phase can embodied certain complications (can not must). Some examples.
    1. Parse - provide an xml to define data types.
    2. Generate - provide a template file used to generate the code, define where the output goes, insure existing files not overwritten, etc.
    Your description sounds like a one shot - in that you will not be generating every everytime but rather will generate it once and then modify it.
    Oh. I had found a wikipedia page about a design method called DRY, basically it pointed out that I could do just what I am wanting to do, but unfortunately I cannot seem to find an example or any detailed information about this method.
    The only general books I have found on the subject is one directed at Perl (Perl Munging) which is sort of related and one for .Net (or maybe java) but which is directed at a proprietary commercial product.
    This is what I have rolling around in my head at the moment:
    The use a bunch of strings and printf("%s, args) ...to build this entire page, then go in and enter the things that I couldn't generate.
    I could see this working, but I had felt this would go against code resuability because when the class/things I would generate would change, I would have to do some serious changes to this to get it working again. (Maybe that is the point).
    Code generation has its best usage if you can recognize a pattern and then implement it such that manual modifications are not needed. This however is tempered by the requirement that I first mentioned that the generated code must be maintainable by itself.

  • Html tag mixed with java?

    I have a form containing a combo box on my JSP page. Basically, i want one of these options in the combo box be dynamically selected according to the value of property(docType) stored in a javaBean(myBean). Someone actually helped me a couple of days ago, saying the following bits of code would accomplish this task. I just couldnt make it work properly although i've been hardly thinking of it for a quite long time. Hope someone can help me sort it out or give me some tips. Hope i explained it clearly. Thanks in advance.
    <select name="docType">
    <option value="book"<?= ("book".equals(myBean.getDocType())) ? "selected" : "" ?>>book</option>
    <option value="article"<?= ("article".equals(myBean.getDocType())) ? "selected" : "" ?>>article</option>
    <option value="report"<?= ("report".equals(myBean.getDocType())) ? "selected" : "" ?>>report</option>
    </select>

    Have you tried it with <%=%> instead of <?=?> yet?
    Kind regards,
    Levinot yet, actually. Obviously, i know <% %> is used for embedding java expression inside HTML code. But i am wondering why i was being told using <?= ?> above? I never seen this tag in JSP before, do u have any idea?
    ps. i'll have a try with <% %>, see if it works.

  • Crystal report generation with Java Bean AS  Data source on RAD

    <p>Hi,</p><p>&#160;</p><p>          Our company wants report generation in IBM RAD 7.0  using crystal reports with a Java Bean as data source. i HAVEN&#39;T FOUND ANY ARTICLES TO WORK ON RAD. Any inputs appreciated..</p><p>&#160;</p><p>Thanks,</p><p>Manju</p>

    Look for Java POJO in the doc, i'm using RAD 7.0 and it's working like RAD 6.0

  • Modified HTML code created with iWeb fails to update

    Hi. I have a bunch of iWeb files used to create a simple Web site. I want to change ONE word of text in the HTML file, the only one with the actual text for the page. All the support files are graphics files (png, jpg) and there's a .css file and a .js file as well. These exist for every page on the site.
    I opened the relevant HTML file in Text Wrangler and made the change. Saved the file. The modified file shows up in the Finder with the new timestamp. Groovy. However, if I then open the file in Safari to display the actual page + graphics + navigation, it displays the OLD text. Can someone tell me what's going on and how  I can modify the text. For that matter, where on earth is Safari getting the old text from in the first place. That file has been overwritten.
    Oh, I am doing this on a new iMac with Mavericks. I haven't had a copy of iWeb for several years. I thought it was a problem with the browser cache, but closing and reopening the browser did not help. I also created a test version of the modified file with a new name and opened that in Safari but it too displayed the same strange behavior (the unmodified text). Whenever I examine the text in Text Wrangler, the modification is there, however.

    I see what the problem is. It's not the browser. The problem is that the HTML text is encoded in a small .png file that cannot be modified. Here's a snippet of the relevant code. As you can see the code references "shape image_2.png." That file contains the same text as shown below, but unmodified, of course. Since I don't have iWeb on Mavericks, I have no way of regenerating the PNG file. Kind of a problem since I can't modify or update my site. Good old Apple. 
      <div style="height: 1px; line-height: 1px; " class="tinyText"> </div>
              <img src="overview_files/shapeimage_2.png" alt="Over twenty years’ experience as a full-time free-lance translator from the French.&#10;Primary focus: intellectual property (patents and related litigation, prior art, office actions, research papers).&#10;As an ATA-certified translator from the French, I provide language services to clients here and abroad, primarily in the field of intellectual property and IP litigation. I work primarily with manufacturing and technology companies, patent attorneys and law firms. Because I focus on a single language pair and area of practice, I can offer my clients publication-quality translations that can be customized to meet their needs. &#10;Translations can be certified upon request. For larger translation projects, I offer on-site document triage to help you streamline your litigation efforts and reduce translation costs.&#10;Experience in the following fields: telecommunications, information technology, electronics, chemistry, chemical engineering, pharmaceuticals, law, machine tools and numerical control, industrial safety and environmental safety, bid documents, contracts, marketing and public relations, film and TV (scripts).&#10;Clients include leading US law firms, Fortune 500 corporations, international organizations, book and magazine publishers.&#10;Former adjunct professor (technical translation), New York University, Foreign Language Department, SCPE. &#10;Former lecturer, (terminology and translation) CUNY/Graduate School, Translation Program. &#10;&#10;" title="" id="id1" style="height: 506px; margin-left: 98px; margin-top: 109px; position: relative; width: 468px; z-index: 1; " />
    <img src="overview_files/shapeimage_3.jpg" alt="OVERVIEW" title="" style="height: 41px; left: 38px; position: absolute; top: 26px; width: 622px; z-index: 1; " />

  • Turn off automatic code generation in Java Studio Creator

    A feature in Java Studio Creator automatically adds getter methods for all managed beans in every Page Bean, getter methods for all Session Beans and Application Beans in every newly created Session Bean and so on.
    What is annoying is if these automatically generated code is commented out or deleted, they are added back again by the IDE.
    We have a large project where the number of managed beans is quite significant. It doesn't make sense to clutter the code for every managed bean with unnecessary getter methods. Is there a way this feature can be disabled?

    I have a similar situation.
    I have a large project with several classes with properties.
    It is convenient to use the 'add properties' option to add a property to the class.
    However, when you do that, it is a private member and you need getter and setter methods to access the private members.
    What I do to get around this is to just create a class and manually add properties as public members so they can be accessed without getter or setter methods.
    By doing this, you expose these members to the world, but for large projects where the classes are not intended to be available for general use, you cut down the generated code by about 80%.
    The other advantage is that you can define all the class members at the start of your class and avoid the problem of having the definition and getter / setter methods concatenated at the bottom of the class.

  • Code generation through Java Reflection

    Hi
    I am after some clarification about the possibility of mapping of method outputs to other method inputs, using java reflection.
    The java objects are described in an XML based language (called DAML) as follows
    <java:Method rdf:ID="meth1" java:priority="1">
    <java:methodName>buildQuery</java:methodName>
    <java:parentClass>afsw.query.QueryBuilder</java:parentClass>
    <java:methodParameters rdf:parseType="daml:collection">
    <java:Parameter>
    <java:inORout>input</java:inORout>
    <java:type>java.util.Hashtable</java:type>
    </java:Parameter>
    </java:methodParameters>
    </java:Method>
    and I want to map them back to method calls and instantiations, so to be able to generate code on the fly. I need to know if its is possible to pass the output of a method such as getQuery() which in this case is a Document to the input of constructor MsgModule as in the following example:
    Document queryDoc =qc.getQuery();
    MsgModule mg= new MsgModule(queryDoc);
    regards
    Charlie

    This is possible. What you need to do in the 'new' instance case is to find the best constructor. So let's say you have Class clazz, the class you want to create a new instance of, and Class[] params, an array of objects to pass in the constructor. Using the Class api you can do:
    Constructor constructor = clazz.getConstructor(params);The getConstructor method will only return an exact match. Let's say one of the parameters was a subclass of an class that is allowable in the constructor. You can get all the constructors via clazz.getConstructors() and get all the parameters types via Constructor.getParameterTypes() and check to see if the params you passed in are compatible. You can use Class.isAssignableFrom() to help resolve this. Once you find the constructor, use Constructor.newInstance(params) to create the new instance. Hope this helps.

  • HTML code generation question

    Hi, I'm newby to JSF technology,
    I'd like to ask what kind of HTML it generates
    for UI components contained in JSF page.
    Is there any support for XHTML?
    Thanks for advice,
    M.

    might be worth reading this post
    http://forum.java.sun.com/thread.jspa?threadID=579517&messageID=4042224

  • CE 7.1 SP3 Code generation for Java 1.4.2

    Hi,
    Is it possible to use the Ce 7.1 SP3 environment to develop components for WAS 6.4 ?. 
    Though I have configured the compiler to be Java 1.4 compliant, the code generated still contains Java 5 constructs and thus will not compile correctly. (e.g. @SuppressWarnings("unused")).
    Thanks

    NO chance.
    Regards,
    Benny

  • Inconsistent code generation with wsdl2java tool

    I am creating web service using axis2 , with top down approach. Initially thought of using the SOAP based webservices and created the wsdl like below.
    <wsdl:message name="CreateObjInput">
         <wsdl:part name="CreateObjRequest" element="tns:CreateObjectRequest">
    </wsdl:part>
    </wsdl:message>
    <wsdl:message name="CreateObjOutput">
         <wsdl:part name="CreateObjResponse" element="tns:CreateObjectResponse">
    </wsdl:part>
    </wsdl:message>
    <wsdl:operation name="CreateObjectOperation">
         <wsdl:input name="CreateObjInput" message="tns:CreateObjInput" />
         <wsdl:output name="CreateObjOutput" message="tns:CreateObjOutput" />
    </wsdl:operation>
    <wsdl:operation name="CreateObjectOperation">
         <soap:operation soapAction="http://xyz.com/CreateObject" style="document" />
         <wsdl:input>
         <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
         <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    Wsdl2java generated the service interface like below (Using Axis data bindings)
    public CreateObjectResponse createObjectOperation(CreateObjectRequest request)
    Now at the closure of project decided to convert the service as RESTful service. So I changed the wsdl like below very minimal change.
    <wsdl:message name="CreateObjInput">
         <wsdl:part name="CreateObjRequest" element="tns:CreateObjectRequest">
         </wsdl:part>
    </wsdl:message>
    <wsdl:message name="CreateObjOutput">
         <wsdl:part name="CreateObjResponse" element="tns:CreateObjectResponse">
         </wsdl:part>
    </wsdl:message>
    <wsdl:operation name="CreateObjectOperation">
         <wsdl:input name="CreateObjInput" message="tns:CreateObjInput" wsaw:Action="urn:createObjectRequest"/>
         <wsdl:output name="CreateObjOutput" message="tns:CreateObjOutput" wsaw:Action="urn:createObjectOperationResponse"/>
    </wsdl:operation>
    <wsdl:operation name="CreateObjectOperation">
         <http:operation location="createObjectOperation" />
         <wsdl:input>
              <mime: type="text/xml" part="CreateObjRequest" />
         </wsdl:input>
         <wsdl:output>
              <mime: type="text/xml" part="CreateObjResponse" />
         </wsdl:output>
    </wsdl:operation>
    and the wsdl2java command generated the interface like below.
    public CreateObjectResponse createObjectOperation(CreateObjectOperation createObjectOperation)
    I tried many ways to get the interface definition like in the firstcase but didn't succeeded. This is causing the classname changes in the entire project.
    Didn't understand why its generating interface like this though the wsdl is the same except wsaw actions included.
    Can any one help me the get the inteface generated in compatible with the first case..
    Thanks,
    Sridhar
    Edited by: 917949 on Feb 29, 2012 2:42 PM

    There is a new Version of Code4Flex Alpha 0.0.9.
    http://sourceforge.net/projects/code4flex
    This version is for Ganymede Eclipse.
    Enjoy
    Code4Flex Team

  • How to generate html-code using csv input with JSP or JAVA???

    Hello,
    I want to read out a .csv-file and generate html-code dynmically with JSP in an EP6 Application. The problem is, that the csv-file can’t be located or openend.
    BTW if every knows a good tutorial or weblog for this, please post the link.
    It’s located in a par-archive under:
    />dist>files
    I tried various methods, in the doContent mehtod or with JSP. Everytime same result.
    Here part of the code I tried in the doContent():
    public class CSV extends AbstractPortalComponent
        public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
            String strWRoot = request.getWebResourcePath();
            String contentCSV="", line="";
            String linesep = System.getProperty("line.separator");
            File fileLoadCSV = new File(strWRoot+"/files/ma_infosysteme.csv");
            boolean exCSV = fileLoadCSV.exists();
            boolean reCSV = fileLoadCSV.canRead();
            int a=0;
            if(exCSV&&reCSV){
                response.write("ok");
                try {
                  BufferedReader inputCSV = new BufferedReader(new FileReader(fileLoadCSV));
                  while((line=inputCSV.readLine())!=null){
                    contentCSV=contentCSVlinelinesep;
                    a++;
                  inputCSV.close(); 
                catch(IOException ioex){
                    System.out.println("Fehler");  
            else {
                response.write("not ok");
            response.write("<br>Wroot: "+strWRoot);
            response.write("<br>File: "+fileLoadCSV);
            response.write("<br>exists: "+exCSV);
            response.write("<br>read: "+reCSV);
            response.write("<br>Input: "+contentCSV);
    The Output is:
    not ok
    Wroot: /irj/portalapps/DHTML
    File: \irj\portalapps\DHTML\files\ma_infosysteme.csv
    exists: false
    read: false
    Input:
    So thanks to everyone who can give me a good hint.
    Bye.

    Without really looking too much into this it looks like the problem is with the way in which you are trying to open the file. I believe that when creating a File object you need to use a physical path. By using the getWebResourcePath() method you are retrieving the URL to this file and not the physical path name. There is another method (can't remember the exact name) called getPublicResourcePath() (or something similar) which will return the physical path to this file, i.e. c:\usr\sap\.....etc. If you try it this way it may well work
    I hope this helps
    D

  • Looking for a convertor from HTML to PDF with J2SE

    Hi all,
    My current project would generate some XML data and display it on the web. Needless to say I have to prepare a matching set of XSL to transform the XML into HTML. I got that part done.
    However, my project also requires a PDF output of the same XML data for download. Well, I planned to do the XSL-fo stuff on it as well. But at some point the client thought since new kind of XML data may be added and it's too troublesome to maintain 2 sets of XSLs, they are requesting a converter to translate HTML directly into PDF now.
    I've searched the web, and found a few converter. But all of them are written in C and can't be embeded directly into my Java code. And my servlet might not have rights to call an external program on the production machine.
    I would appreciate very much if anyone can share their experience on similar issue, using a Java component to convert HTML into PDF. Suggestion of commercial products or open source freeware are all welcome.
    Thank you very much.

    HTML to PDF with Java, using OpenOffice.org - example here: [http://www.dancrintea.ro/html-to-pdf/|http://www.dancrintea.ro/html-to-pdf/]
    You can use OpenOffice.org, running as a server and command it remotely for document convertion.
    Besides HTML to PDF, there are also possible other convertions:
    doc --> pdf, html, txt, rtf
    xls --> pdf, html, csv
    ppt --> pdf, swf
    Code example:
    import officetools.OfficeFile; // this is my tools package
    FileInputStream fis = new FileInputStream(new File("c:/test.html"));
    FileOutputStream fos = new FileOutputStream(new File("c:/test.pdf"));
    // suppose OpenOffice.org runs on localhost, port 8100
    OfficeFile f = new OfficeFile(fis,"localhost","8100", true);
    f.convert(fos,"pdf");
    -----------------------------------------------------------------------------------------------------------------------------------------

  • How to do pagination with oracle along with java

    hi
    i want to know how to use pagination codes along with java.

    Are you sure that you're on the right forum? This is the forum for Berkeley DB, Java Edition, and we don't support SQL.
    Linda

Maybe you are looking for

  • Flash button to external video

    Hello there, i want my button to open external video, but not in a new window, just to play it in some portion of the screen.The thing is: I made my first flash based website and i want to add some animations which i made(in 3ds max),but if i get it

  • Calling sql from a shell script

    I have code like the following sqlplus -s /nolog >> EOF select 1 from dual; EOF Is it possible for me to pass result set to a shell variable or do I have to spool it to a file and then read the file?

  • ISE 1.3 and Instant Access "Limited support"

    Hello The Cisco 1.3 compatability matrix http://www.cisco.com/c/en/us/td/docs/security/ise/1-3/compatibility/ise_sdt.pdf indicates that "Limited support, some functionalities are not supported" applies to ISE 1.3 Profiling when using Cat 6848ia switc

  • Best way to install Panther on Bondi Blue Rev B

    The computer is my friend's free Bondi Blue Rev B which is currently running OS 9. I have a retail set of Panther discs and would like to update the OS to Panther for my friend. The previous owner of the Bondi Blue has requested that her information

  • Operation Unprepare failed for application 'createObject'. Error - weblogic

    I am getting this exception when i undeploy my application in JDev 11.1.1.3.0 has anyone else encountered similer problem ? <Aug 18, 2010 3:53:16 PM IST> <Warning> <Deployer> <BEA-149251> <Operation Unprepare failed for application 'createObject'. Er