Sample java studio creator application for displaying in three languages

please send me a sample web application in java studio creator which should consists of hyperlinks to display web application in three languages french german and engish when i click on the hyperlink

please send me a sample web application in java studio creator which should consists of hyperlinks to display web application in three languages french german and engish when i click on the hyperlink

Similar Messages

  • Is Java Studio Creator only for very little projects?

    Hi
    I'm developing a large program with about 100-pages. I found terrible to navigate by ApplicationOutline, Property Binding and Page Navigation.
    1. ApplicationOutline should show subfolder structure hierarchically
    2. Property Binding should open the page of the binding element, and hierarchical property should be alphabetically sorted
    3. Graphical Page Navigation is just a game. I need only a tree view with add/delete management
    of navigation-rule
    Thanks
    Nicola Grippaldi

    "Sun Java Studio Creator 2, Early Access
    Please be aware of the following issues:
    * There are a number of known issues with the Refactoring feature.
    Before using it:
    - Make a backup of your project
    - Read the full Release Notes referenced below
    * Avoid using subfolders for your web pages.
    * You might have deployment problems, such as:
    - OutOfMemory exceptions
    - Theme switching not taking effect
    - Some other deployment failure
    If you do have these deployment problems, then:
    1) Undeploy.
    2) Stop the Application Server.
    2) Clean the build.
    3) Start the Application Server and redeploy.
    * Projects created in Creator 1.0 can be imported, but you cannot
    use the new components on the imported pages. We are investigating
    creating a conversion utility to the new page structure.
    The Sun Java Studio Creator 2 Installation and Release Notes provides
    information on installing and uninstalling the product and describes
    known bugs and issues. The document is located at:
    http://developers.sun.com/prodtech/javatools/jscreator/ea/jsc2/reference/docs/Installation_ReleaseNotes-ea.html
    Thank you for evaluating our Early Access release."
    This is the content of the README.html.
    Creator is only a preview and you should not try to use it with large web sites. The tool has so many bugs and performance lacks, many features seem not to be tested by Sun that it would be a waste of time.

  • Error in deploying the java studio creator application to tomcat

    Hi,
    I'm trying to deploy my Sun Java Studio application to Apache Tomcat 5.0.28.
    A simple JSF web application built using the creator works fine after deploying the war file under tomcat/weapps directory.
    In case of a application with databse connection I'm getting the
    " com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' "
    above error. My application connects to Oracle database using the Oracle Server type provided by the Studio Creator.
    I have copied
    jstl.jar
    standard.jar
    to webapps\%app%\WEB-INF\lib
    The below url is currently not available ( Page not Found )stated as a solution in most of the querries regarding the deplyment to tomcat.
    http://developers.sun.com/prodtech/javatools/jscreator/reference/tips/deploy_to_tomcat.html
    Thanks for any help
    abhi

    I had similar problems.
    I used mysql with tomcat and have mysql in my Creator environment as well but still had the driver message you experienced.
    I found that simply copying the WAR file into the webapp directory in tomcat caused a faulty deployment (it was creating /etc/tomcat5/localhost/YourProject.xml as a directory, not as a file)
    I updated my Projects/MyProject/build.xml to include a deploy target and I manually execute the ant deploy step (having not figured out how to tweak the internal ant within Creator)
    Note that this requires two jar files (see comments in the ant definition)
    <project name="YourRoster" default="default" basedir=".">
        <description>Builds, tests, and runs the project YourProject.</description>
        <import file="nbproject/build-impl.xml"/>
       <property file="build.properties"/>
       <property name="appdir" value="."/>
       <property name="distdir" value="${appdir}/dist"/>
       <property name="warfile" value="${distdir}/${app}.war"/>
       <property name="builddir" value="${appdir}/build"/>
       <path id="classpath">
          <pathelement location="${servlet.api.jar}"/>
          <pathelement location="${jsp.api.jar}"/>
          <fileset dir="${builddir}/WEB-INF/lib">
             <include name="*.jar"/>
          </fileset>  
       </path>
       <!-- requires tomcat/server/lib/catalina-ant.jar -->
       <target name="lrp-init">
          <tstamp/>
          <fail unless="app" message="Run ant -Dapp=... or update 'build.properties'"/>
       </target>
       <target name="deploy-tomcat" depends="dist"
          description="Deploy web application.">
          <echo message="Deploying ${app} ..."/>
          <taskdef name="deploy"  
             classname="org.apache.catalina.ant.DeployTask"/>
          <deploy url="${manager.url}" username="${username}"
             password="${password}" path="/${app}"
             war="file:${warfile}"/>
       </target>
       <target name="undeploy-tomcat" depends="lrp-init"
          description="Undeploy web application.">
          <echo message="Undeploying ${app} ..."/>
          <taskdef name="undeploy"   
             classname="org.apache.catalina.ant.UndeployTask"/>
          <undeploy url="${manager.url}" username="${username}"
             password="${password}" path="/${app}"/>
       </target>
       <!-- requires ant-contrib (http://ant-contrib.sourceforge.net) -->
       <target name="try.undeploy-tomcat" depends="lrp-init"
          description="Call the undeploy task (which may fail).">
          <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> 
          <trycatch>
             <try>
                <ant target="undeploy-tomcat"/>
             </try>
             <catch/>
          </trycatch>
       </target>
       <target name="redeploy-tomcat" depends="try.undeploy-tomcat,deploy-tomcat"
          description="Undeploy and deploy web application.">
       </target>
    </project>In addition, the build.properties...
    jsf.dir=/opt/jsf-1_1_01
    tomcat.dir=/opt/tomcat5
    app=YourProject
    username=tomcatAdminUser
    password=tomcatPassword
    manager.url=http://localhost:8080/manager
    servlet.api.jar=${tomcat.dir}/common/lib/servlet-api.jar
    jsp.api.jar=${tomcat.dir}/common/lib/jsp-api.jar
    jsf.lib.dir=${jsf.dir}/lib
    jstl.lib.dir=${tomcat.dir}/webapps/jsp-examples/WEB-INF/lib
    commons.lib.dir=${tomcat.dir}/server/lib
    jsf.libs=jsf-api.jar,jsf-impl.jar
    jstl.libs=jstl.jar,standard.jar
    commons.libs=commons-beanutils.jar,commons-digester.jarHope this helps.
    ...Lyall

  • Sjds2 and Java studio creator 2

    Hello
    is there a particular download version of Java studio creator 2 for JDS2?
    In the Studio Creator prerequisites document for linux, the supported OS is Red hat linux
    regards
    Raul

    Hi Abdelkrim,
    Try to place variable ArrayList mySelectedXXX
    to SessionBean and change your prerender code to something like that to reflect changes:
    //prerenderer method
    // you need this check in order to execute this code only first time page is rendered
    if (getSessionBean1().getMySelectedXXX() == null) {
        getSessionBean1().setMySelectedXXX(new ArrayList());
        while (resultSet.next()) {
            getSessionBean1().getMySelectedXXX().add(new Long(resultSet.getLong("id_XXX")));
        checkboxGroup1.setSelected(getSessionBean1().getMySelectedXXX());
    }Also you'll need to execute getSessionBean1().setMySelectedXXX(null); when you leave the page.
    Roman.

  • Cloudscape & Java Studio Creator - Need Connection URL for toursDB

    Has anyone been able to create a data source and connect to the bundled demo databases in the default Cloudscape installation (sample or toursDB) with Java Studio Creator on MacOS X.
    I have Cloudscape running ok and I have Java Studio Creator running and I added the "derby.jar" and "derbytools.jar" files to the jar list in Java Studio creator but I'm not sure what the connection URL should be to connect to the example databases.

    Well, I think I now to having everything working!! I was able to connect to one of the sample Clouldscape databases (bundled with the Cloudscape 10.0 distribution in SJCS) - I had to do the following
    --- 1 --- After downloading a Java tool called DbVisualizer Free 4.1.1 and reviewing its documentation I was able to discover how to set an essential Java System Property for it as well as Sun Java Studio Creator on MacOS X. The property was derby.storage.fileSyncTransactionLog=true. This was needed to work around an Apple Java VM problem by bypassing code that uses write sync (rws) mode. The info for this is on the Apache site at: http://www.ibm.com/Search?q=Cloudscape+failures+on+Mac&v=14?=en&cc=zz&Search.x=47&Search.y=10 and the info for setting system properties on "double clickable Java Apps" on MacOS X can be found at: http://www.dbvis.com/products/dbvis/doc/4.1.1/doc/ug/admin/admin.html
    --- 2 --- Using the tool in *1* above I then actually got it to connect to an existing sample bundled Cloudscape database using the following connection URL jdbc:derby:/pathToTheDatabaseDirectory (needed to add the path to the URL) and the userID and Password as user1,user1 for reasons stated in the following forum link http://www-128.ibm.com/developerworks/forums/dw_thread.jsp?forum=370&thread=66046. I also used the driver class org.apache.derby.jdbc.EmbeddedDriver.
    --- 3 --- Finally, using the config info I used in *2* above I then used the following settings in Sun Java Studio Creator
    DataSource Settings Panel Fields set as follows (for Cloudscape 10.0 installation)
    DisplayName ---> Cloudscape
    JDBC Driver Jar Files ---> derby.jar
    Driver Class Name ---> org.apache.derby.jdbc.EmbeddedDriver
    URL Template ---> jdbc:derby:
    And then......Add Data Source panel fields set as follows
    ---DataSourceName --> datasource1
    ---ServerType____ Cloudscape
    ---HostName ---> left this blank
    UserID -> user1
    ---Password ---> user1
    ---DatabaseURL ---> jdbc:derby:/Applications/IBM/Cloudscape_10.0/derbyDB
    ---DriverClass ---> org.apache.derby.jdbc.EmbeddedDriver
    thanks for your help. I had been able to connect to Cloudscape programmatically (which your blog documents well), but getting the Sun Java Studio Creator (SJSC) IDE configured for Cloudscape wasn't obvious. Hopefully the above info in *1* and *3* will help anyone using the SJSC IDE on MacOS X. The DbVisualizer Free 4.1.1 is a slick tool I discovered along the way as well.

  • Developing applications with Sun Java Studio Creator

    I downloaded Sun Java Studio Creator yesterday. I'm developing a Java application, however when I went to create a new project there only appeared to be web-related projects that could be created so I haven't figured out how to create a new application project.
    Does this program allow you to create stand-alone java applications??
    thanks,
    Doug

    What JSR says is true. The advantage of using Netbeans is that it works much faster than Java Studio Creator. It also has some nifty wizards for helping create various kinds of java projects.
    However, Java Studio creator is in fact based on Netbeans and it is possible to use JSC to create a java application. Do do so, click on Create New Project, then under Categories, select General...Java Class Library. JSC will create a new project for you with the name you provide. If you then go over to the project browser and right click your mouse on Source Packages and select New...Java Class it will create a class file for you that you can then write your java code into.
    In the project browser you can then right click your mouse over the class you created to compile it and run it.
    Daren

  • Cloudscae & Java Studio Creator - Need Connection URL for toursDB

    Has anyone been able to create a data source and connect to the bundled demo databases in the default Cloudscape installation (sample or toursDB) with Java Studio Creator on MacOS X.
    I have Cloudscape running ok and I have Java Studio Creator running and I added the "derby.jar" and "derbytools.jar" files to the jar list in Java Studio creator but I'm not sure what the connection URL should be to connect to the example databases.

    1. load up the embedded driver.
    2. use jdbc:derby:toursDB as the database URL.

  • Directory JFileChooser for Java Studio Creator

    Hello,
    I need a way to browse and select directories from my Java Studio Creator JSP pages. The only thing I can find is the multipart form file upload stuff. But that does not allow me to just pick a directory. Does anyone know of any way to do this?
    Thanks,
    Jeff

    An applet can.
    I made one to allow unlimited fileuploads(at the same time) to the server. I know you can buy them but hey, it was fun.
    Jonathan.

  • How to call Web Services with Sun Java Studio Creator?

    Can someone from Sun please explain how to use the sample Web Services USWeather and GoogleSearch in Sun Java Studio Creator (no Portlet Application)?
    I read the Web Service Tutorial Accessing Web Services (http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/webservices.html) and this blog entry: http://blogs.sun.com/roller/page/winston?entry=code_google_search_in_no .
    But the proposed solutions do not work with the services USWeather and GoogleSearch.
    Thank you.

    Thank you for your answer, dongmei.
    It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
    E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
          <s:element name="GetWeatherReport">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetWeatherReportResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
    The question is how can I get the response GetWeatherReportResult from the service.

  • Problem with Java Studio Creator and Tomcat Server

    Hi Gays ,
    I have problem:
    here is the error from tomcat 5
    com.sun.rave.web.ui.appbase.ApplicationException: org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: statement handle not executed: getMetaData
    com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.destroy(ViewHandlerImpl.java: 601)
    com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.ja va:316)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87 )
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:221)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
    com.sun.rave.web.ui.util.UploadFilter.doFilter(UploadFilter.java:194)
    if i develop application on my pc ( java studio creator with sun apps bundlled) is working perfectly,
    but i migrated application to Tomcat Server ( Database the same - Oracle 10 g)
    i can't show value ( as text) from datasoruce ( is in SessionBean1)
    (Category-.>Subcat->Items->details( url from items table[items.jsp])
    this is a working url "/faces/testpage.jsp?auk_id=31 "
    ( working with sun apps server , but not on Tomcat 5)
    below prerender method in details.java and fragment of details.jsp
    public void prerender() {
    try {
    String idauk = (getExternalContext().getRequestParameterMap().get("auk_id").toString());
    System.out.println("wartosc auk_id " + idauk);
    if (idauk != null) {
    getSessionBean1().getDetailsRowSet().setObject(1,idauk);
    getSessionBean1().getDetailsDataProvider().refresh();
    details.jsp
    xml version="1.0" encoding="UTF-8"?>
    <jsp:root version="1.2" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:ui="http://www.sun.com/web/ui">
    <jsp:directive.page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"/>
    <f:view>
    <ui:page binding="#{testpage.page1}" id="page1">
    <ui:html binding="#{testpage.html1}" id="html1">
    <ui:head binding="#{testpage.head1}" id="head1">
    <ui:link binding="#{testpage.link1}" id="link1" url="/resources/stylesheet.css"/>
    </ui:head>
    <ui:body binding="#{testpage.body1}" id="body1" style="-rave-layout: grid">
    <ui:form binding="#{testpage.form1}" id="form1">
    <ui:staticText binding="#{testpage.staticText1}" id="staticText1" style="position: absolute; left: 120px; top: 96px" text="#{SessionBean1.testDataProvider.value['Name']}"/>
    </ui:form>
    </ui:body>
    </ui:html>
    </ui:page>
    </f:view>
    </jsp:root>
    Help People ! Any Ideas I'm stuck, why is working with Sun Servet but not with Tomcat and only just thing ?
    Thanks in advance for helping me to resolve the night problem :)

    Hi I found solution, i puted on the page a table -component (with brand new automaticly created dataprovider) , then i set properties visible= false for table, and now I can bind statictext with database field and deploy on tomcat server .
    But i think it is not a elegant solution in page source i habe noused-code.
    Have Any another Ideas. HELP PEOPLE !!!!
    Mariuszek: I use Creator.because right now I can see result of my job and i can qickly change ideas ,
    I tried with JDeveleper but i did'nt find this functionality (wich version do you prefered ?) , unfortunately i have to deploy my application on Tomcat. This is my study project, and i make this to become a Master of Techinal Univeristy ;), Deadline time is 30 th September :(
    greetings

  • Help needed with Sun Java Studio Creator and EJB in a Portlet Project

    Hi
    I have created an web-application with JSF in Sun Java Studio Creator 2. The web application uses a lot of EJB's which acts as the dataProviders. In a typical jsp page i have more that one data providers(the EJB's) getting used. When i run the project everything opens up properly in the browser and the application seems to be fine.
    But when i create a JSP 168 Portlet project and do exactly the same thing for some reason the Apache Pluto(comes as the default Portlet Container with Studio Creator) conks off.
    Then i started going ahead step by step:
    1. First i created a portletpage and added only one dataProvider(EJB) and ran the project...It gets deployed properly in Pluto and the browser comes up and everything shows up fine.
    2. Just to re-confirm i did the same thing with another dataProvider(EJB). So still we have just 1 EJB in the portlet page. As expected it also worked fiine.
    3. Then when I added more that one dataProviders(EJBs) in the porlet page the Apache Pluto conks off(saying that Pluto is not available)
    I tried doing a lot of things but nothing works...Surprisingly the same thing works when u create a JSF web Application project but the same thing does not work when u create a JSR 168 JSF Portlet Project...
    Did anybody face the same problem..Is it a bug in the Studio Creator...Any help would be highly appreciated.

    Hi,
    There are a few discussion threads in the feedbackprograms portal for Creator 2 EA 2. The URL is:
    https://feedbackprograms.sun.com/login.html
    In the EA discussion forum you will find threads which discuss the concerned topic. In specific look for threads titled:
    # Deploying Portlets
    # Taking a JSC Portlet to Tomcat creates a Faces Mapping Error
    # Problem with Pluto when trying to deploy a portlet
    # Request: JSR-168 Portlet Project without JSF
    We kindly request you to post your further queries related to EA in the above mentioned forum.
    Cheers
    Giri

  • Problems with the resources boundles in java studio creator 2

    I try to migrate a proyect from sun java studio creator 2 early access to sun java studio creator 2 but I have a problem, the resource bundle work in creator 2 early access but doesn� work in creator 2, somebody have the same problem?
    and, the most important somebody could fix the problem?
    Note. sorry I�m learning english

    If I choose for SJSC2 to create JSF applications then
    one, or better THE, reason is the (drag and drop)
    Design editor functionality.
    Using resource bundles is a MUST. So if this means I
    cannot use the Design Editor in combination with
    resource bundles, then I will use something else...
    I think there should be a statement issued by the
    SJSC2 team about this bug and what the timescale for
    a decent solution wll be.
    Regards,
    Marcel
    BTW: overall SJSC2 seems to be a good alternative to
    develop an open source JSF application in a competing
    timeframe.I agree. This bug is even more exacerbated by the fact that the error message is entered in the design form and generally clutters more room than was originally intented for the text. Not having i18n is a show stopper right now. Creator2 will have to fully support i18n before we can start using it.

  • How to do internationalization with Sun Java Studio Creator?

    Hi everybody,
    the Sun Java Studio Creator seems to be a great peace of software ;-) Currently I'm trying to design some forms for a hello-world-test-project. My question now is: how can I realize internationalization with property-bundles? I already managed it to create my own bundles, I set up a few locales (de, en, fr) and put in some "SayHello" Variables. But how can I associate my locale-variables in the .propertie-files with the value- or text-attributes of the UI-Components using the form designer?

    well... it's not working!
    I created some locale-properties. Put a
    <f:loadBundle basename="mypackage.mainlocales" var="messages"/>directly under the "<f:view>"-Tag as it is descriped in the manual.
    But when I write something like
    <ui:label binding="#{sites$main$mainmenu.label1}" id="label1" style="position: absolute; left: 312px; top: 168px" text="#{messages.test}"/>The designer crashes with an error-message:
    javax.faces.el.PropertyNotFoundException: Error testing property 'test' in bean of type null
         at com.sun.faces.el.PropertyResolverImpl.getType(PropertyResolverImpl.java:342)
         at com.sun.rave.web.ui.faces.UIComponentPropertyResolver.getType(UIComponentPropertyResolver.java:298)
         at com.sun.rave.web.ui.faces.DataProviderPropertyResolver.getType(DataProviderPropertyResolver.java:264)
         at com.sun.jsfcl.data.ResultSetPropertyResolver.getType(ResultSetPropertyResolver.java:141)
         at com.sun.rave.jsfsupp.container.DesignTimePropertyResolver.getType(DesignTimePropertyResolver.java:169)
         at com.sun.faces.el.impl.ArraySuffix.getType(ArraySuffix.java:240)
         at com.sun.faces.el.impl.ComplexValue.getType(ComplexValue.java:208)
         at com.sun.faces.el.ValueBindingImpl.getType(ValueBindingImpl.java:350)
         at com.sun.rave.web.ui.renderer.ValueHolderDesignTimeRenderer.encodeBegin(ValueHolderDesignTimeRenderer.java:59)
         at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)Nevertheless - when I deploy my application, the locales are processed correctly.
    What am I doing wrong?

  • Using Servlets in java studio creator

    Hello, anyone can tell me how can i use a servlet in java studio creator, due the file is in .java i dont know how to use it, here is an example i want to add to my proyect:
    and other question is how can i make to work?
    * Sean C. Sullivan
    * June 2003
    * URL: http://www.seansullivan.com/
    package pdfservlet;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.io.ByteArrayOutputStream;
    import java.io.PrintWriter;
    // import the iText packages
    import com.lowagie.text.*;
    import com.lowagie.text.pdf.*;
    * a servlet that will generate a PDF document
    * and send the document to the client via the
    * ServletOutputStream
    * @author Sean C. Sullivan
    public class PDFServlet extends HttpServlet
         public PDFServlet()
              super();
         * we implement doGet so that this servlet will process all
         * HTTP GET requests
         * @param req HTTP request object
         * @param resp HTTP response object
         public void doGet(HttpServletRequest req, HttpServletResponse resp)
              throws javax.servlet.ServletException, java.io.IOException
              DocumentException ex = null;
              ByteArrayOutputStream baosPDF = null;
              try
                   baosPDF = generatePDFDocumentBytes(req, this.getServletContext());
                   StringBuffer sbFilename = new StringBuffer();
                   sbFilename.append("filename_");
                   sbFilename.append(System.currentTimeMillis());
                   sbFilename.append(".pdf");
                   // Note:
                   // It is important to set the HTTP response headers
                   // before writing data to the servlet's OutputStream
                   // Read the HTTP 1.1 specification for full details
                   // about the Cache-Control header
                   resp.setHeader("Cache-Control", "max-age=30");
                   resp.setContentType("application/pdf");
                   // The Content-disposition header is explained
                   // in RFC 2183
                   // http://www.ietf.org/rfc/rfc2183.txt
                   // The Content-disposition value will be in one of
                   // two forms:
                   // 1) inline; filename=foobar.pdf
                   // 2) attachment; filename=foobar.pdf
                   // In this servlet, we use "inline"
                   StringBuffer sbContentDispValue = new StringBuffer();
                   sbContentDispValue.append("inline");
                   sbContentDispValue.append("; filename=");
                   sbContentDispValue.append(sbFilename);
                   resp.setHeader(
                        "Content-disposition",
                        sbContentDispValue.toString());
                   resp.setContentLength(baosPDF.size());
                   ServletOutputStream sos;
                   sos = resp.getOutputStream();
                   baosPDF.writeTo(sos);
                   sos.flush();
              catch (DocumentException dex)
                   resp.setContentType("text/html");
                   PrintWriter writer = resp.getWriter();
                   writer.println(
                             this.getClass().getName()
                             + " caught an exception: "
                             + dex.getClass().getName()
                             + "<br>");
                   writer.println("<pre>");
                   dex.printStackTrace(writer);
                   writer.println("</pre>");
              finally
                   if (baosPDF != null)
                        baosPDF.reset();
         * @param req must be non-null
         * @return a non-null output stream. The output stream contains
         * the bytes for the PDF document
         * @throws DocumentException
         protected ByteArrayOutputStream generatePDFDocumentBytes(
              final HttpServletRequest req,
              final ServletContext ctx)
              throws DocumentException
              Document doc = new Document();
              ByteArrayOutputStream baosPDF = new ByteArrayOutputStream();
              PdfWriter docWriter = null;
              try
                   docWriter = PdfWriter.getInstance(doc, baosPDF);
                   doc.addAuthor(this.getClass().getName());
                   doc.addCreationDate();
                   doc.addProducer();
                   doc.addCreator(this.getClass().getName());
                   doc.addTitle("This is a title.");
                   doc.addKeywords("pdf, itext, Java, open source, http");
                   doc.setPageSize(PageSize.LETTER);
                   HeaderFooter footer = new HeaderFooter(
                                       new Phrase("This is a footer."),
                                       false);
                   doc.setFooter(footer);
                   doc.open();
                   doc.add(new Paragraph(
                                  "This document was created by a class named: "
                                  + this.getClass().getName()));
                   doc.add(new Paragraph(
                                  "This document was created on "
                                  + new java.util.Date()));
                   String strServerInfo = ctx.getServerInfo();
                   if (strServerInfo != null)
                        doc.add(new Paragraph(
                                  "Servlet engine: " + strServerInfo));
                   doc.add(new Paragraph(
                                  "This is a multi-page document."));
                   doc.add( makeGeneralRequestDetailsElement(req) );
                   doc.newPage();
                   doc.add( makeHTTPHeaderInfoElement(req) );
                   doc.newPage();
                   doc.add( makeHTTPParameterInfoElement(req) );
              catch (DocumentException dex)
                   baosPDF.reset();
                   throw dex;
              finally
                   if (doc != null)
                        doc.close();
                   if (docWriter != null)
                        docWriter.close();
              if (baosPDF.size() < 1)
                   throw new DocumentException(
                        "document has "
                        + baosPDF.size()
                        + " bytes");          
              return baosPDF;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeHTTPHeaderInfoElement(final HttpServletRequest req)
              Map mapHeaders = new java.util.TreeMap();
              Enumeration enumHeaderNames = req.getHeaderNames();
              while (enumHeaderNames.hasMoreElements())
                   String strHeaderName = (String) enumHeaderNames.nextElement();
                   String strHeaderValue = req.getHeader(strHeaderName);
                   if (strHeaderValue == null)
                        strHeaderValue = "";
                   mapHeaders.put(strHeaderName, strHeaderValue);
              Table tab = makeTableFromMap(
                        "HTTP header name",
                        "HTTP header value",
                        mapHeaders);
              return (Element) tab;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeGeneralRequestDetailsElement(
                                  final HttpServletRequest req)
              Map mapRequestDetails = new TreeMap();
              mapRequestDetails.put("Scheme", req.getScheme());
              mapRequestDetails.put("HTTP method", req.getMethod());
              mapRequestDetails.put("AuthType", req.getAuthType());
              mapRequestDetails.put("QueryString", req.getQueryString());
              mapRequestDetails.put("ContextPath", req.getContextPath());
              mapRequestDetails.put("Request URI", req.getRequestURI());
              mapRequestDetails.put("Protocol", req.getProtocol());
              mapRequestDetails.put("Remote address", req.getRemoteAddr());
              mapRequestDetails.put("Remote host", req.getRemoteHost());
              mapRequestDetails.put("Server name", req.getServerName());
              mapRequestDetails.put("Server port", "" + req.getServerPort());
              mapRequestDetails.put("Preferred locale", req.getLocale().toString());
              Table tab = null;
              tab = makeTableFromMap(
                                  "Request info",
                                  "Value",
                                  mapRequestDetails);
              return (Element) tab;
         * @param req HTTP request object
         * @return an iText Element object
         protected Element makeHTTPParameterInfoElement(
                             final HttpServletRequest req)
              Map mapParameters = null;
              mapParameters = new java.util.TreeMap(req.getParameterMap());
              Table tab = null;
              tab = makeTableFromMap(
                        "HTTP parameter name",
                        "HTTP parameter value",
                        mapParameters);
              return (Element) tab;
         * @param firstColumnTitle
         * @param secondColumnTitle
         * @param m map containing the data for column 1 and column 2
         * @return an iText Table
         private static Table makeTableFromMap(
                   final String firstColumnTitle,
                   final String secondColumnTitle,
                   final java.util.Map m)
              Table tab = null;
              try
                   tab = new Table(2 /* columns */);
              catch (BadElementException ex)
                   throw new RuntimeException(ex);
              tab.setBorderWidth(1.0f);
              tab.setPadding(5);
              tab.setSpacing(5);
              tab.addCell(new Cell(firstColumnTitle));
              tab.addCell(new Cell(secondColumnTitle));
              tab.endHeaders();
              if (m.keySet().size() == 0)
                   Cell c = new Cell("none");
                   c.setColspan(tab.columns());
                   tab.addCell(c);
              else
                   Iterator iter = m.keySet().iterator();
                   while (iter.hasNext())
                        String strName = (String) iter.next();
                        Object value = m.get(strName);
                        String strValue = null;
                        if (value == null)
                             strValue = "";
                        else if (value instanceof String[])
                             String[] aValues = (String[]) value;
                             strValue = aValues[0];
                        else
                             strValue = value.toString();
                        tab.addCell(new Cell(strName));
                        tab.addCell(new Cell(strValue));
              return tab;
    }

    Hi, i've done all described in the posts, but i
    don't know how to call the servlet, using the web
    browser, and more, how can i call the servlet frrom
    a button action? or hyperlink?
    nks for the helpOk, I am not sure what you are trying to do. For these events you can
    use the SessionBean. What do you want the servlet to do that the session bean can't?
    I use the sessionbean because I don't know how to receive or respond to xmlhttpreq messages directly in my sessionbean. If you just need the standard http req/resp it doesn't seem like a servlet is needed.

  • Can java studio creator import MIME?

    HI , i have 2 question
    1.> i am tring to make a page that stream music .wma usually in normal html
    <object id="mediaPlayer"
    classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
    codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715"
    type = "application/x-oleobject">
    <param name="autostart" value="true">
    <param name="showcontrols" value="true">
    <param name="filename" value="here ... music...name">
    <param name="ShowStatusBar" value="true">
    <embed type="application/x-mplayer2"pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="question.wma" autostart="0" showcontrols="1" showstatusbar="1">
    </embed> </object>
    in java studio creator can i use that ? on the place to put music name can i gain control so i can put what ever name i want depend on user?
    2.> I make a class use File myFile = new File ("C:\\Music"); last time it's work but now it said source cannot be found? how do i fix that?
    thank you for advise

    Here comes your help;-) Or at least I hope so;-)
    The problem is, that you really want components in order to be able to change parameters etc from your application.
    http://blogs.sun.com/roller/page/marcoscorner#my_adventure_in_component_land
    Have fun;-)
    -- Marco

Maybe you are looking for