Javabeans in Netscape HTML

I have a need to access a client side java bean from an html doc displayed by Netscape.
I have looked into the object and embed tags, but the examples I have seen are for applets.
I cannot work with an applet.
So if anyone can point me to a website or example that shows how netscape can work with a client side javabean, I would be very grateful.
Thanks for the help.
Mark Kozikowski
[email protected]

I too want the same thing to be done,if
you find out the way for doing so,i would also
like to know.
thanks a lot

Similar Messages

  • How do I attach a JavaBean to a HTML Form submission

    I found an example in the O'Reilly JavaServer Pages book that shows you how to pass a JavaBean from a JSP to a servlet.
    <jsp:useBean id="userInfo" scope="request" class="com.ora.jsp.beans.userinfo.UserInfoBean">
    <jsp:setProperty name="userInfo" property="*" />
    </jsp:useBean>
    <jsp:forward page="/myServlet" />
    Then in the servlet, you do:
    UserInfoBean userInfo = ( UserInfoBean )request.getAttribute("userInfo");
    I want to do almost the exact same thing...but I don't want to forward the request. I want to pass the JavaBean along as part of an HTML form submission. Can anyone help me out with this? Thanks.

    Assuming that you have setup your environment correctly and you have a web application server like Tomcat running.
    Since you didn't provide the code for the bean I created my own. You can change the code any way you want.
    Say UserInfoBean is :
    package test17;
    public class UserInfoBean {
        String firstName;
        String lastName;
        public UserInfoBean() {
        public String getFirstName() {
            return firstName;
        public void setFirstName(String firstName) {
            this.firstName = firstName;
        public String getLastName() {
            return lastName;
        public void setLastName(String lastName) {
            this.lastName = lastName;
    }And say you have a JSP page like this:
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
      <head><title></title></head>
      <body>
      <jsp:useBean id="userInfo" scope="request" class="test17.UserInfoBean">
      <jsp:setProperty name="userInfo" property="*" />
      </jsp:useBean>
      <form action="index.jsp" method="POST">
          <input type="text" name="firstName" value="${userInfo.firstName}"/>
          <br/><br/>
          <input type="text" name="firstName" value="${userInfo.lastName}"/>
          <br/><br/>
          <input type="submit" name="submit" value="submit"/>
      </form>
      </body>
    </html>If you access the JSP page like this:
    http://localhost:8080/p/test17/index.jsp?firstName=George&lastName=W
    then it passes in the request parameter from the query string and populates the form.
    Once the form is populated if you submit the form , data is transmitted to the next page , and you can access it via request.getParameter.
    Is this the solution you are looking for?

  • Is this a javabean?

    I am a newcomer in java and I am taking over the codes from my predecessor. And today i read some javabean codes below. but there seems to be no difference between javabean and the general class?
    ------------------------------------------------------code-------------
    package com.hqcomm.beans;
    import java.io.PrintStream;
    import java.sql.*;
    public class DbBean
    public ResultSet executeQuery(Connection connection, String s)
    ResultSet resultset = null;
    try
    Statement statement = connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    resultset = statement.executeQuery(s);
    catch(SQLException sqlexception)
    System.err.println("db.executeQuery: " + sqlexception.getMessage());
    return resultset;
    public int executeSQL(Connection connection, String s)
    int i = 0;
    try
    Statement statement = connection.createStatement();
    i = statement.executeUpdate(s);
    statement.close();
    catch(SQLException sqlexception)
    System.err.println("db.executeUpdate: " + sqlexception.getMessage());
    return i;
    public boolean changepwd(Connection connection, String s, String s1)
    boolean flag;
    flag = false;
    try
    String s2 = " update A_Register set C_PassWD = '" + s1 + "' where RegisterId = '" + s + "' ";
    Statement statement = connection.createStatement();
    int i = statement.executeUpdate(s2);
    System.out.println(s2 + "****" + i);
    if(i == 1)
    flag = true;
    else
    flag = false;
    statement.close();
    catch(Exception exception)
    System.err.println(exception);
    return flag;
    public static String toChinese(String s)
    try
    if(s == null)
    return null;
    else
    s = new String(s.getBytes("ISO-8859-1"), "GB2312");
    return s;
    catch(Exception exception)
    return null;
    }

    All java beans are java
    classes and not vice-versa. Wrong, for example the Math or System class aren't beans.
    A class needs to meet certain requirements in order to call itself bean.
    One is to hava a public constructor, which does not take any arguments.
    For the official specs of java beans see
    http://java.sun.com/products/javabeans/docs/spec.html
    and documents referenced therein.
    For a lot of the day to day work you can use the strongly simplified version:
    a bean is a class with a public constructor an properties which a accessible through getPropertyName and setPropteryName
    regards
    Spieler

  • JavaBeans discontinued?

    Is there any point in doing any bean development?
    I want to create some controls that I can use in a Java (J)applet or application (not sure which, possibly both). To be able to use the controls in a VC++ application would be nice, but that's not a priority.
    I'm not sure whether I should bother getting into Bean development after reading the Sun website:
    "The BDK software is no longer being developed and is provided for educational and demonstration purposes only."
    (http://java.sun.com/products/javabeans/software/bdk_download.html)
    Does this mean that Java beans are no longer supported or soon to be discontinued?
    There's another sentence which I hope I've misinterpreted:
    "The JavaBeans Bridge for ActiveX is currently part of the Java Plug-In. The ActiveX Bridge has been discontinued as of J2SE release 1.4."

    Of course not.
    http://java.sun.com/products/javabeans/
    and a new beanbuilder
    http://java.sun.com/products/javabeans/beanbuilder/index.html

  • JavaBeans & no-arg-constructor

    Hi,
    I'm new to JavaBeans and while reading the JavaBeans API Specification (Version 1.01, as I couldn't find a newer version), I was faced with the question:
    Why doesn't the definition of a bean in this specification contain the fact that a bean must have a public no-arg constructor?
    Every bean I've yet seen did contain a no-arg constructor and everybody says they had to do so. But could anyone please point me to the section in the specification (http://www.java.sun.com/products/javabeans/docs/spec.html) from which this fact logically follows? Maybe I just didn't recognize it when reading, maybe it just follows implicitly...
    Perhaps somebody also knows if there will be a new version of the spec. For example, the current version says: "All beans must support either Serialization or Externalization" though long term storage was introduced in JDK v1.4. Where can I find a draft for such a new spec if there is any?
    Thanx

    You're quite right, but you'll have to admit that the section you quoted is just a possible scenario (at the beginnig of chapter 3, the spec says Note that this section is intended to be illustrative rather than prescriptive).
    I'm still wondering if a class that looks like a bean but has no default constructor either is not a bean or is a bean, but not supported by current JDKs.
    In fact, the XML bean persistence allows you to make objects persistent which don't support a default constructor (i.e. they might just provide a factory method). And the method Beans.getInstanceOf(Object, Class) could (in future releases) make it possible to take an Object containing all initialization info as it's first argument and then initialize a new "bean" without using a default constructor.
    Of course, if we could call such a "bean" without no-arg-constructor really a bean, this wouldn't change much as we couldn't use it in our today 's builder tools. But wouldn't it be nice some day to have beans with some non-mutable properties that you can just specify at the creation point of such a bean?
    Please let me know your opinion!
    Stefan

  • Browser plug-in & Java components

    I post my topic here as I realized the JavaBean forum wasn't the right place. Sorry for the double post.
    As part of an application, I have developped a specific component/javabean that displays some data that may be stored in a file (*.ppp).
    I would like to register that component so that IE, Netscape, etc. use it to display a file when a user clicks on a or when a corresponding content-type is reached. This effect is actually used by Adobe for its pdf file format: when a user clicks on a .pdf link, the pdf will be displayed in the browser window.
    I found several strategies to (apparently) achieve this. Which ones are working? Which ones should be used? Which ones spare the most rewritting? Which ones are the most convenient for the user?
    - Using the JAF, JAVABEANS ACTIVATION FRAMEWORK (see http://java.sun.com/products/javabeans/glasgow/jaf.html). Does it work for IE?
    - Using the Java bridge for ActiveX (see http://java.sun.com/products/javabeans/software/bridge/). IE now requires plug-in to be written as ActiveX...
    - Java Pluglet API (see http://www.mozilla.org/projects/blackwood/java-plugins/). But does it work for IE? It does not even seem maintained...How would I rewrite my bean?
    I wish there was just a simple mechanism where you register your jar component and it would be used automatically when the browser reached the corresponding content-type :D
    Thanksfoo.ppp<a /> or when a corresponding content-type is reached. This effect is actually used by Adobe for its pdf file format: when a user clicks on a .pdf link, the pdf will be displayed in the browser window.
    I found several strategies to (apparently) achieve this. Which ones are working? Which ones should be used? Which ones spare the most rewritting? Which ones are the most convenient for the user?
    - Using the JAF, JAVABEANS ACTIVATION FRAMEWORK (see http://java.sun.com/products/javabeans/glasgow/jaf.html). Does it work for IE?
    - Using the Java bridge for ActiveX (see http://java.sun.com/products/javabeans/software/bridge/). IE now requires plug-in to be written as ActiveX...
    - Java Pluglet API (see http://www.mozilla.org/projects/blackwood/java-plugins/). But does it work for IE? It does not even seem maintained...How would I rewrite my bean?
    I wish there was just a simple mechanism where you register your jar component and it would be used automatically when the browser reached the corresponding content-type :D
    Thanks

    You can get it done at : http://www.thesoftwareobjects.com

  • How do you create beans using NetBeans 5.5?

    I am referring to http://java.sun.com/docs/books/tutorial/javabeans/nb/index.html and I'm sorry but I can't follow any of this!
    I have NetBeans IDE 5.5 and I am trying to learn how to write beans using NetBeans, and the lessons involve things I can't find or understand, for example:
    re: http://java.sun.com/docs/books/tutorial/javabeans/writingbean/index.html
    <blockquote>
    Load the JAR file. Use the NetBeans IDE GUI Builder to load the jar file as follows:
    1. Start NetBeans.
    2. From the File menu select "New Project" to create a new application for your bean. You can use "Open Project" to add your bean to an existing application.
    3. Create a new application using the New Project Wizard.
    4. Select a newly created project in the List of Projects, expand the Source Packages node, and select the Default Package element.
    5. Click the right mouse button and select New|JFrameForm from the pop-up menu.
    6. Select the newly created Form node in the Project Tree. A blank form opens in the GUI Builder view of an Editor tab.
    7. Open the Palette Manager for Swing/AWT components by selecting Palette Manager in the Tools menu.
    8. In the Palette Manager window select the beans components in the Palette tree and press the "Add from JAR" button.
    9. Specify a location for your SimpleBean JAR file and follow the Add from JAR Wizard instructions.
    10. Select the Palette and Properties options from the Windows menu.
    11. Expand the beans group in the Palette window. The SimpleBean object appears. Drag the SimpleBean object to the GUI Builder panel.
    </blockquote>
    Sorry, you lost me literally after "Start NetBeans", the rest is Hungarian. I can't find "New Project Wizard"; I can't find "List of Projects", I can't find anything they are talking about nor do I know if any of this is relevant toward my learning how to write beans.
    Re: http://java.sun.com/docs/books/tutorial/javabeans/properties/properties.html
    "Inspecting Properties" seems impossible to do because the Inspector Window only shows a closed folder and nothing else ever. I can't figure out this part of the tutorial either.
    Can someone please explain this 3rd-grade-level to me: How to create a bean using NetBeans?
    Thanx
    Phil

    Phil,
    Before you embark on another very frustrating advanture using NetBeans, please go t hrough the NetBeans tutorial. The "New Project Wizard" is just select from the menu options -- "New Project". The "Hungarian" as you put it will not get better until you spend some time learning NetBeans. Learning something new, like beans, is frustrating enough, but to try to do it and use a tool that is not familiar may be beyond many individuals frustration level.
    Les

  • Error while compiling Web Dynpro program due to missing JAR files

    Hi Experts,
    I am getting error message while compiling Web Dynpro program. The erring lines are as below:
              Message message = new MimeMessage(session);
              try {
                   message.setFrom(new InternetAddress(fromMailId));
                   message.addRecipient(
                        Message.RecipientType.TO,
                        new InternetAddress(toMailId));
                   message.setSubject(mailSubject);
                   message.setText(mailBody);
                   message.setHeader("X-Mailer", "E-Mail");
                   message.setSentDate(new Date());
                   Transport.send(message);
    The error messages are:
    Message.ReceipientType can not be resolved
    The method send(Message) is undefined for the type Transport
    The method setFrom(InternetAddress) is undefined for the type Message
    The method setHeader(String, String) is undefined for the type MessageThe method setSentDate(Date) is undefined for the type Message
    The method setSubject(String) is undefined for the type Message
    The method setText(String) is undefined for the type Message
    Type mismatch: cannot convert from MimeMessage to Message
    Can you please help me in resolving the issue. It seems that some API is missing. I believe if some one can tell me the name of JAR file / API then I will be able to sort out the issue. I will add these JAR file in my program.
    Thanks,
    S

    HI Stuart,
    you are missing the jar files required for sending mail in java
    Installing JavaMail
    You will need the latest version of JavaMail (Version 1.2) available here:
    http://java.sun.com/products/javamail/
    Download and unzip the file, in the newly created top level JavaMail directory you will find a number of jar files,
    these need adding to your classpath.
    To do this in Eclipse, right click on your project in the tree view, select properties, select the libraries tab.
    Now click the 'Add external jars' button, navigate to your JavaMail directory and click on the jars.
    The tutorial also makes use of the Java Activation Framework, which is available here:
    http://java.sun.com/products/javabeans/glasgow/jaf.html
    Instalation of JAF is identical to JavaMail
    activation.jar / mail.jar are 2 distinct names i remember rest you will get above
    P.S: close the question to assist other users narrow the search and find solutions
    Message was edited by:
            Armin Reichert

  • I'm getting an exception while sending a mail . .

    i'm get an excpetion while sending a mail, example i'm getting
    this particular error
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/activation/DataSource
    at MailTest.<init>(MailTest.java:25)
    at MailTest.main(MailTest.java:42)
    this is my code
    pls help me out
    import java.io.IOException;
    import java.io.PrintWriter;
    import java.util.Properties;
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    public class MailTest
         String mailHost = "mail.business-functions.com";
         String to = "[email protected]";
         String from = "[email protected]";
         String subject = "This is Test Mail Thru Java Mail API";
         String body = "This is Test Mail to check whether the Java Mail APi is Working or not. This is prototype developed by Snehal K gandhi of Business Functions Software Solutions Pvt Ltd.";
         Provider provider;
         public MailTest()
              try
                   Properties props = System.getProperties();
                   props.put("mail.smtp.host", mailHost);
                   Session session = Session.getInstance(props,null);
                   Message message = new MimeMessage(session);
                   message.setFrom(new InternetAddress(from));
                   message.setRecipients(Message.RecipientType.TO,new InternetAddress[]{new InternetAddress(to)});
                   message.setSubject(subject);
                   message.setContent(body, "text/plain");
                   Transport.send(message);
                   System.out.println("Mail has been Sent");
              catch(MessagingException me)
                   System.out.println("2. Error While Sending the Mail and the exception is : " + me.toString());
         public static void main(String arg[])
              new MailTest();
    ***********************************************************************/

    <sigh>
    You need activation.jar in your classpath and or
    import javax.activation.*;
    See the JavaMail Readme for more info.
    If you haven't got JAF get it here
    http://java.sun.com/products/javabeans/glasgow/jaf.html
    Rgds,
    SH

  • Error in Jsp page - undefined type

    <html>
    <%@ page contentType="text/html; charset=utf-8"
    import="java.io.InputStream,
    java.io.IOException,
    javax.xml.parsers.SAXParser,
    java.lang.reflect.*,
    java.io.Writer.*, java.util.*,
    javax.xml.parsers.SAXParserFactory"
    session="false" %>
    <%
    * Copyright 2002,2004,2005 The Apache Software Foundation.
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    * http://www.apache.org/licenses/LICENSE-2.0
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    %>
    <%!
    * Happiness tests for axis. These look at the classpath and warn if things
    * are missing. Normally addng this much code in a JSP page is mad
    * but here we want to validate JSP compilation too, and have a drop-in
    * page for easy re-use
    * @author Steve 'configuration problems' Loughran
    * @author dims
    * @author Brian Ewins
    * test for a class existing
    * @param classname
    * @return class iff present
    Class classExists(String classname) {
    try {
    return Class.forName(classname);
    } catch (ClassNotFoundException e) {
    return null;
    * test for resource on the classpath
    * @param resource
    * @return true iff present
    boolean resourceExists(String resource) {
    boolean found;
    InputStream instream=this.getClass().getResourceAsStream(resource);
    found=instream!=null;
    if(instream!=null) {
    try {
    instream.close();
    } catch (IOException e) {
    return found;
    * probe for a class, print an error message is missing
    * @param out stream to print stuff
    * @param category text like "warning" or "error"
    * @param classname class to look for
    * @param jarFile where this class comes from
    * @param errorText extra error text
    * @param homePage where to d/l the library
    * @return the number of missing classes
    * @throws IOException
    int probeClass(JspWriter out,
    String category,
    String classname,
    String jarFile,
    String description,
    String errorText,
    String homePage) throws IOException {
    try {
    Class clazz = classExists(classname);
    if(clazz == null) {
    String url="";
    if(homePage!=null) {
    url=getMessage("seeHomepage",homePage,homePage);
    out.write(getMessage("couldNotFound",category,classname,jarFile,errorText,url));
    return 1;
    } else {
    String location = getLocation(out, clazz);
    if(location == null) {
    out.write("<li>"+getMessage("foundClass00",description,classname)+"</li><br>");
    else {
    out.write("<li>"+getMessage("foundClass01",description,classname,location)+"</li><br>");
    return 0;
    } catch(NoClassDefFoundError ncdfe) {
    String url="";
    if(homePage!=null) {
    url=getMessage("seeHomepage",homePage,homePage);
    out.write(getMessage("couldNotFoundDep",category, classname, errorText, url));
    out.write(getMessage("theRootCause",ncdfe.getMessage(), classname));
    return 1;
    * get the location of a class
    * @param out
    * @param clazz
    * @return the jar file or path where a class was found
    String getLocation(JspWriter out,
    Class clazz) {
    try {
    java.net.URL url = clazz.getProtectionDomain().getCodeSource().getLocation();
    String location = url.toString();
    if(location.startsWith("jar")) {
    url = ((java.net.JarURLConnection)url.openConnection()).getJarFileURL();
    location = url.toString();
    if(location.startsWith("file")) {
    java.io.File file = new java.io.File(url.getFile());
    return file.getAbsolutePath();
    } else {
    return url.toString();
    } catch (Throwable t){
    return getMessage("classFoundError");
    * a class we need if a class is missing
    * @param out stream to print stuff
    * @param classname class to look for
    * @param jarFile where this class comes from
    * @param errorText extra error text
    * @param homePage where to d/l the library
    * @throws IOException when needed
    * @return the number of missing libraries (0 or 1)
    int needClass(JspWriter out,
    String classname,
    String jarFile,
    String description,
    String errorText,
    String homePage) throws IOException {
    return probeClass(out,
    "<b>"+getMessage("error")+"</b>",
    classname,
    jarFile,
    description,
    errorText,
    homePage);
    * print warning message if a class is missing
    * @param out stream to print stuff
    * @param classname class to look for
    * @param jarFile where this class comes from
    * @param errorText extra error text
    * @param homePage where to d/l the library
    * @throws IOException when needed
    * @return the number of missing libraries (0 or 1)
    int wantClass(JspWriter out,
    String classname,
    String jarFile,
    String description,
    String errorText,
    String homePage) throws IOException {
    return probeClass(out,
    "<b>"+getMessage("warning")+"</b>",
    classname,
    jarFile,
    description,
    errorText,
    homePage);
    * get servlet version string
    public String getServletVersion() {
    ServletContext context=getServletConfig().getServletContext();
    int major = context.getMajorVersion();
    int minor = context.getMinorVersion();
    return Integer.toString(major) + '.' + Integer.toString(minor);
    * what parser are we using.
    * @return the classname of the parser
    private String getParserName() {
    SAXParser saxParser = getSAXParser();
    if (saxParser == null) {
    return getMessage("couldNotCreateParser");
    // check to what is in the classname
    String saxParserName = saxParser.getClass().getName();
    return saxParserName;
    * Create a JAXP SAXParser
    * @return parser or null for trouble
    private SAXParser getSAXParser() {
    SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
    if (saxParserFactory == null) {
    return null;
    SAXParser saxParser = null;
    try {
    saxParser = saxParserFactory.newSAXParser();
    } catch (Exception e) {
    return saxParser;
    * get the location of the parser
    * @return path or null for trouble in tracking it down
    private String getParserLocation(JspWriter out) {
    SAXParser saxParser = getSAXParser();
    if (saxParser == null) {
    return null;
    String location = getLocation(out,saxParser.getClass());
    return location;
    * Check if class implements specified interface.
    * @param Class clazz
    * @param String interface name
    * @return boolean
    private boolean implementsInterface(Class clazz, String interfaceName) {
    if (clazz == null) {
    return false;
    Class[] interfaces = clazz.getInterfaces();
    if (interfaces.length != 0) {
    for (int i = 0; i < interfaces.length; i++) {
    if (interfaces.getName().equals(interfaceName)) {
    return true;
    return false;
    %>
    <%@ include file="i18nLib.jsp" %>
    <%
    // initialize a private HttpServletRequest
    setRequest(request);
    // set a resouce base
    setResouceBase("i18n");
    %>
    <head>
    <title><%= getMessage("pageTitle") %></title>
    </head>
    <body bgcolor='#ffffff'>
    <%
    out.print("<h1>"+ getMessage("pageTitle") +"</h1>");
    out.print("<h2>"+ getMessage("pageRole") +"</h2><p/>");
    %>
    <%= getLocaleChoice() %>
    <%
    out.print("<h3>"+ getMessage("neededComponents") +"</h3>");
    %>
    <UL>
    <%
    int needed=0,wanted=0;
    * the essentials, without these Axis is not going to work
    // need to check if the available version of SAAJ API meets requirements
    String className = "javax.xml.soap.SOAPPart";
    String interfaceName = "org.w3c.dom.Document";
    Class clazz = classExists(className);
    if (clazz == null || implementsInterface(clazz, interfaceName)) {
    needed = needClass(out, "javax.xml.soap.SOAPMessage",
         "saaj.jar",
    "SAAJ API",
    getMessage("criticalErrorMessage"),
    "http://ws.apache.org/axis/");
    } else {
    String location = getLocation(out, clazz);
    out.print(getMessage("invalidSAAJ",location));
    out.print(getMessage("criticalErrorMessage"));
    out.print(getMessage("seeHomepage","http://ws.apache.org/axis/java/install.html",getMessage("axisInstallation")));
    out.print("<br>");
    needed+=needClass(out, "javax.xml.rpc.Service",
    "jaxrpc.jar",
    "JAX-RPC API",
    getMessage("criticalErrorMessage"),
    "http://ws.apache.org/axis/");
    needed+=needClass(out, "org.apache.axis.transport.http.AxisServlet",
    "axis.jar",
    "Apache-Axis",
    getMessage("criticalErrorMessage"),
    "http://ws.apache.org/axis/");
    needed+=needClass(out, "org.apache.commons.discovery.Resource",
    "commons-discovery.jar",
    "Jakarta-Commons Discovery",
    getMessage("criticalErrorMessage"),
    "http://jakarta.apache.org/commons/discovery/");
    needed+=needClass(out, "org.apache.commons.logging.Log",
    "commons-logging.jar",
    "Jakarta-Commons Logging",
    getMessage("criticalErrorMessage"),
    "http://jakarta.apache.org/commons/logging/");
    needed+=needClass(out, "org.apache.log4j.Layout",
    "log4j-1.2.8.jar",
    "Log4j",
    getMessage("uncertainErrorMessage"),
    "http://jakarta.apache.org/log4j");
    //should we search for a javax.wsdl file here, to hint that it needs
    //to go into an approved directory? because we dont seem to need to do that.
    needed+=needClass(out, "com.ibm.wsdl.factory.WSDLFactoryImpl",
    "wsdl4j.jar",
    "IBM's WSDL4Java",
    getMessage("criticalErrorMessage"),
    null);
    needed+=needClass(out, "javax.xml.parsers.SAXParserFactory",
    "xerces.jar",
    "JAXP implementation",
    getMessage("criticalErrorMessage"),
    "http://xml.apache.org/xerces-j/");
    needed+=needClass(out,"javax.activation.DataHandler",
    "activation.jar",
    "Activation API",
    getMessage("criticalErrorMessage"),
    "http://java.sun.com/products/javabeans/glasgow/jaf.html");
    %>
    </UL>
    <%
    out.print("<h3>"+ getMessage("optionalComponents") +"</h3>");
    %>
    <UL>
    <%
    * now the stuff we can live without
    wanted+=wantClass(out,"javax.mail.internet.MimeMessage",
    "mail.jar",
    "Mail API",
    getMessage("attachmentsError"),
    "http://java.sun.com/products/javamail/");
    wanted+=wantClass(out,"org.apache.xml.security.Init",
    "xmlsec.jar",
    "XML Security API",
    getMessage("xmlSecurityError"),
    "http://xml.apache.org/security/");
    wanted += wantClass(out, "javax.net.ssl.SSLSocketFactory",
    "jsse.jar or java1.4+ runtime",
    "Java Secure Socket Extension",
    getMessage("httpsError"),
    "http://java.sun.com/products/jsse/");
    * resources on the classpath path
    /* add more libraries here */
    %>
    </UL>
    <%
    out.write("<h3>");
    //is everythng we need here
    if(needed==0) {
    //yes, be happy
    out.write(getMessage("happyResult00"));
    } else {
    //no, be very unhappy
    response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
    out.write(getMessage("unhappyResult00",Integer.toString(needed)));
    //now look at wanted stuff
    if(wanted>0) {
    out.write(getMessage("unhappyResult01",Integer.toString(wanted)));
    } else {
    out.write(getMessage("happyResult01"));
    out.write("</h3>");
    %>
    <UL>
    <%
    //hint if anything is missing
    if(needed>0 || wanted>0 ) {
    out.write(getMessage("hintString"));
    out.write(getMessage("noteString"));
    %>
    </UL>
    <h2><%= getMessage("apsExamining") %></h2>
    <UL>
    <%
    String servletVersion=getServletVersion();
    String xmlParser=getParserName();
    String xmlParserLocation = getParserLocation(out);
    %>
    <table border="1" cellpadding="10">
    <tr><td>Servlet version</td><td><%= servletVersion %></td></tr>
    <tr><td>XML Parser</td><td><%= xmlParser %></td></tr>
    <tr><td>XML ParserLocation</td><td><%= xmlParserLocation %></td></tr>
    </table>
    </UL>
    <% if(xmlParser.indexOf("crimson")>=0) { %>
    <p>
    <%= getMessage("recommendedParser") %>
    </p>
    <% } %>
    <h2><%= getMessage("sysExamining") %></h2>
    <UL>
    <%
    * Dump the system properties
    java.util.Enumeration e=null;
    try {
    e= System.getProperties().propertyNames();
    } catch (SecurityException se) {
    if(e!=null) {
    out.write("<pre>");
    for (;e.hasMoreElements();) {
    String key = (String) e.nextElement();
    out.write(key + "=" + System.getProperty(key)+"\n");
    out.write("</pre><p>");
    } else {
    out.write(getMessage("sysPropError"));
    %>
    </UL>
    <hr>
    <%= getMessage("apsPlatform") %>:
    <%= getServletConfig().getServletContext().getServerInfo() %>
    </body>
    </html>
    in the above jsp code i am getting errors such as "1.getMessage(String) is undefined for the type"
    "2. setRequest(HttpServletRequest) is undefined for the type"
    "3. getLocaleChoice() is undefined for the type"
    whats wrong with the code??

    I would also like to mention that you posted the original message... then barely an hour later made a comment that it was still unanswered.
    In my time zone, you posted at 3:32 AM and then commented at 4:35 AM. I don't know about many people here, but I am fast asleep during that time.
    So please understand we are here to help you, not be your servants to fix your problems.

  • Calling Java Android code from XSLT

    I am trying to get an XSLT stylesheet to work that invokes Java code at certain points during execution (used to parse RDFa). You can find a very simple example of such code below:
    <?xml version="1.0" encoding="UTF-8"?>
    <stylesheet
    xmlns:xsl ="http://www.w3.org/1999/XSL/Transform" version="1.0"
    xmlns ="http://www.w3.org/1999/XSL/Transform"
    xmlns:xalan="http://xml.apache.org/xalan"
    xmlns:java="http://xml.apache.org/xalan/java"
    exclude-result-prefixes="java" >
    <xsl:template match="/">
    <value-of select="java:android.xslt_test.XSLTTest.testing()"/>
    </xsl:template>
    </stylesheet>
    Although this XSLT calls the specified method for a Java desktop application, it doesn't do anything in an Android application (no methods are called and the transformer simply returns the original document). After I configured the Transformer instance with a custom ErrorListener subclass instance (via aTransformer.setErrorListener()), I get a NullPointerException (packaged as a TransformerException) when the above XSLT code is parsed. This error does not occur for "normal" XSLT sheets (these are parsed correctly on Android).
    Any ideas on why this doesn't work? Do I need to use another prefix / namespace for Android applications? I've spent quite some time looking online for a solution, but couldn't find any..
    Thanks,
    William

    The question really comes down to "can I call a server-side object from the client side?"
    The answer is "not directly". You can call a client-side JavaBean from JavaScript (e.g. when you use <jsp:plugin/> to embed a JavaBean in the HTML, you can call that from the JavaScript on the client-side.) You can call a server-side JavaBean using server-side code only.
    You can probably set up a framework to cause a function on the client to submit to a servlet which changes the bean on the server, but you can't just call it directly.

  • Abstract way to get Content Type of a File?

    Using a java.io.File or java.io.FileInputStream is there any was the get the mime type of that file? I am working with a JEditorPane which loads files from a JTree, however I would like to take advantage of the tree's setContentType method for formatting...

    I think the
    JAVABEANS ACTIVATION FRAMEWORK (JAF)
    is what you're looking for.
    http://java.sun.com/products/javabeans/glasgow/jaf.html
    But I actually never used it... (or not yet :-) )
    Greets
    Puce

  • Why use Java Beans?

    Why should we use java beans?
    Everybody says it is used to set the properties. What does this mean?
    Can anyone give me a realtime scenario of the problems it can solve?
    How does Spring framework utilize beans to solve problems? i.e wiring beans, declaring them in context file.

    shalearns wrote:
    Why should we use java beans?[http://java.sun.com/docs/books/tutorial/javabeans/index.html]
    Everybody says it is used to set the properties. What does this mean?[http://java.sun.com/docs/books/tutorial/javabeans/whatis/index.html]
    Can anyone give me a realtime scenario of the problems it can solve?[http://java.sun.com/docs/books/tutorial/javabeans/nb/index.html]
    How does Spring framework utilize beans to solve problems? i.e wiring beans, declaring them in context file.[http://static.springframework.org/spring/docs/1.2.x/reference/beans.html]
    ~

  • Bean Builder - no juggler

    Hello,
    I've just installed Bean Builder. In the run.bat file, I changed USE_JAVA=c:\jdk1.4 to USE_JAVA=c:\j2sdk1.4.1_05 which meant I finally got the thing started!...
    But there's no sign of juggler bean anywhere - as described in the on-line tutorial. I've searched through the forum and no-one else seems to have this problem. I'm guessing it's one of three things:
    1. I need to change something else in the run.bat file
    2. I need to download something else as well
    3. I am not starting the application correctly (I am just double-clicking on the run.bat icon. (I'm using Win XP.))
    4. I've unzipped beanbuilder-1_0-beta.zip into the wrong place
    5. The juggler bean is there somewhere but I'm too stupid to see it!
    Can anyone help?
    Thanks,
    James

    you have to clearly distinguish the difference between
    BDK (Bean Development Kit) and BeanBuilder.
    They are 2 different packages.
    After seeing what you wrote you seems to have downloaded BeanBuilder which
    MUST NOT have the Juggler bean contained, while BDK has.
    To download BDK (strongly advice for version 1.1, the earlier version seems
    to have some problems)
    http://java.sun.com/products/javabeans/software/bdk_download.html
    tutorial for BDK is here:
    http://java.sun.com/docs/books/tutorial/javabeans/TOC.html
    http://java.sun.com/docs/books/tutorial/javabeans/
    For BeanBuilder, download from here :
    http://java.sun.com/products/javabeans/beanbuilder/
    tutorial for beanbuilder is here :
    http://java.sun.com/products/javabeans/beanbuilder/1.0/docs/guide/tutorial.html
    Hope I can get the Duke Dollars.
    Thanks !!

  • Need Help Regarding JAVA BEAN

    Is any one tell me that JAVA BEAN only used in WEB or also you in Desktop applications???? and aslo tell how i implement Java class and use JAVA BEAN. I need help regarding above matter
    thanks in advance
    Rehan MIrza

    Here is a good link that indicate that JavaBean is not only for applets
    http://java.sun.com/docs/books/tutorial/javabeans/whatis/beanDefinition.html
    quote:
    The JavaBeans API makes it possible to write component software in the Java programming language. Components are self-contained, reusable software units that can be visually composed into composite components, applets, applications, and servlets using visual application builder tools. JavaBean components are known as Beans.
    Francois

Maybe you are looking for