How to access class method in jsp page

hi ,
I am new to JSP . I want to access a method returning an arraylist
of a class.
this class i saved in WEB-INF>classes folder > where other classes like logonform , etc. are saved ....
import stmt is <%@ page import="java.io.*, java.util.*, readXml " %>
<% readXml rd= new readXml();
Arraylist list=rd.parseDoc();
%>
It is not recognizing readXml class......
Can any body help me in this regard......
plz help .... i m in urgent need
thanks in advance.......

better to put class in a pkg inside webinf> classes folder ...
but in my case constructor was not public......
public readXml(){}
now it works fine...... :)

Similar Messages

  • How to access java method in JSP

    Hi all,
    I need to access java class (abstract portal component) method doContent() in a JSP which is under PORTAL-INF/jsp folder.
    I did
    <%@ page import = "com.mycompany.Aclass" %>
    <%com.mycompany.Aclass a = new com.mycompany.Aclass (); %>
    Aclass is coming as autofill/prepopulated with cntrl+space
    Till this time, it is working. no errors. But when I do
    a.
    a. (a dot) no methods are populating (autofill..cntrl+space) or If I forcebly add method a.doContent(req,res)... at runtime its giving error.
    It's not only with doContent method... Its with any simple methods in that class or any other class.
    (Other than doContent method in the APC java class are prepopulating/autofilling but giving error in runtime)
    Can anyone help me... how to access java method in JSP.
    I already gone through many SDN forum post... and implemented too---but no use I refered below forum thread
    Retrieve values from Java class to JSP
    URGENT! How to call a java class from JSP.
    Calling a java method from jsp file -
    this thread is same as my issue
    Thanks,
    PradeeP

    1st. The classes must be in packages. 2nd, the package that they are in must be under the WEB-INF/classes directory. 3rd Look on google and/or this site for web application deployment

  • How to access class members in jsp??

    i m working in jsp and i make a class Student having attribute name and id and i store it at tomcat\classes\Student.java
    and i store a jsp page at tomcat\webapps\root\student\index.jsp
    now i create object of class Student in jsp page it works
    but when i try to access name(Student.name) or id(Student.id)(or any class member of Student class)it shows error message
    now pls tell me how can i access class members in jsp page.

    i m working in jsp and i make a class Student having attribute name and id and i store it at tomcat\classes\mypack\Student.java
    and i store a jsp page at tomcat\webapps\root\student\index.jsp
    now i create object of class Student in jsp page it works
    but when i try to access name(Student.name) or id(Student.id)(or any class member of Student class)it shows error message
    now pls tell me how can i access class members in jsp page.
    Note: class members r public.

  • Urgent....How can i redirect to my jsp page from servlet in init() method..

    How can i redirect to my jsp page from servlet in init() method..Becoz that servlet is calling while server startsup..so im writing some piece of code in init() method..after that i want to redirect to some jsp page ...is it possible?
    using RequestDispatcher..its not possible..becoz
    RequestDispatcher rd = sc.getRequestDispatcher("goto.jsp");
    rd.foward(req,res);
    Here the request and response are null objects..
    So mi question can frame as how can i get request/response in servlet's init method()..

    Hi guys
    did any one get a solution for this issue. calling a jsp in the startup of the servlet, i mean in the startup servlet. I do have a same req like i need to call a JSP which does some data reterival and calculations and i am putting the results in the cache. so in the jsp there in no output of HTML. when i use the URLConnection i am getting a error as below.
    java.net.SocketException: Unexpected end of file from server
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:707)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:705)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:612)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
    nection.java:519)
    at com.toysrus.fns.alphablox.Startup.callJSP(Unknown Source)
    at com.toysrus.fns.alphablox.Startup.init(Unknown Source)
    at org.apache.tomcat.core.ServletWrapper.doInit(ServletWrapper.java:317)
    so plz do let me know how to call a jsp in the start up of a servlet.
    Thanks
    Vidya

  • How to use self-defined class in a jsp page

    Hello:
    I defined a class for displaying purpose, which is in the different folder(WEB-INF/classes) from my JSP page.
    In my JSP page, I want to create an instance of my class and display something, while I get the following error: "
    org.apache.jasper.JasperException: Unable to compile class for JSP
    An error occurred at line: 12 in the jsp file: /htmls/templateIntro.jsp
    Generated servlet error:
    [javac] Compiling 1 source file
    /home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/templateIntro_jsp.java:72: cannot resolve symbol
    symbol : class Display
    location: class org.apache.jsp.templateIntro_jsp
    Display display=new Display(out);"
    How can I solve this problem? Should I redefine my classpath or there are some other actions I should take.
    T.I.A.
    Oriental Spirit

    Here is what I have done:
    1) in Display.java, add one line "package tools;" on the top, and compile it to
    create Display.class.
    2) create a new folder at
    /home/jiao/jsp_webserver/tomcat/webapps/syllabus/WEB-INF/classes
    named tools and then put the Display.class into the newly created folder.
    3) in my jsp page, add " import="tools.*"
    But it still doesn't work.
    Any ideas? T.I.A.

  • How can i call java class file in jsp page

    Hai,
    i wants to call .class file in jsp page.
    my class file is in C:\jsdk\bin.
    Thanks

    I'm not entirely sure what you mean by "calling a class file", but I'm going to assume that you want to do something like the following in your page:
    <%
    MyClass myClass = new MyClass();
    myClass.someMethod();
    %>etc
    If that's the case, then all you have to do is make sure that the class is in the servlet engine's classpath. You'll probably also need to include an appropriate import statement at the top of the page.
    Hope that helps.

  • How to use protected method in jsp code

    Could anyone tell me how to use protected method in jsp code ...
    I declare a Calendar class , and I want to use the isTimeSet method ,
    But if I write the code as follows ..
    ========================================================
    <%
    Calendar create_date = Calendar.getInstance();
    if (create_date.isTimeSet) System.out.println("true");
    %>
    ============================================================
    when I run this jsp , it appears the error wirtten "isTimeSet has protected access in java.util.Calendar"

    The only way to access a protected variable is to subclass.
    MyCalendar extends Calendar
    but I doubt you need to do this. If you only want to tell if a Calendar object has a time associated with it, try using
    cal.isSet( Calendar.HOUR );

  • How to access a method in webservice catalogued component in BPM Process

    Hi
    Can anyone explain me how to access a method in webservice catalogued component in BPM Process using an imported jsp in bpm process.
    Thanks & Regards
    Ashish

    If Class B only has a reference to an Interface A, and that reference points to a concrete instance of Class A, then of course Class B can still call the method on Interface A. The method for concrete instance Class A is called behind the scenes.
    That's how interfaces work. That's what they're good for.
    Look at the code in the java.sql package for examples. Connection, Statement, ResultSet - all are interfaces. But behind the scenes you're using the concrete implementations provided by your JDBC driver. You don't know or care what those classes are or their package structure. All you do is make calls to the java.sql interface API, and it all works. - MOD

  • Message bundles accessed from JSF and JSP pages

    Hello, everybody!
    I'm developing a localized JSF application. It is working pretty well until now.
    These are my message files:
    mensagens.properties
    mensagens_en_US.propertiesThis is how they're configured in faces-config.xml:
    <application>
        <resource-bundle>
            <base-name>br.urca.www.biblioteca.web.mensagens</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>And this is how I access the messages in a page:
    <h:outputText value="#{msg.titulo}" />Nothing new until now. But now there was a need for me to have a raw jsp page in
    my web application. This page is displaying ok but I also need to access the
    message bundles as I'm able to access in the normal jsp with the JSF components.
    As you should know I can't use something like the above code with an +<h:outputText>+
    to access the messages because this is a JSF component and I'll not be able to use
    JSF components with this raw jsp page.
    So, my question is: how do I access my localized messages from a raw jsp page? I
    suppose there should be a way to do this, but unfortunately I started programming
    to the web world in Java with JSF, not JSP, so I don't know how to do this with
    JSP.
    Thank you very much.
    Marcos

    BalusC wrote:
    Just include [jstl-1.2.jar|https://maven-repository.dev.java.net/repository/jstl/jars/] in your classpath and define the fmt taglib in your JSP. Nothing more is needed.
    Hello, BalusC. Thank you for your help. We're almost there. After I have included the jstl-1.2.jar you provided me I can use the fmt tag and access message bundles from my raw jsp page (even though I had to provide other message bundles instead of the ones that I use in the other jsf pages, but it's better than nothing).
    Now there just on problem to be fixed. The jsp page is not aware when I change the locale of my application. I change this locale in a jsf page.
    I have this component:
    <h:selectOneMenu value="#{pesquisaAcervo.idiomaAplicacao}"
        valueChangeListener="# {pesquisaAcervo.idiomaAplicacaoMudado}" onchange="submit();">
        <f:selectItems value="#{pesquisaAcervo.idiomasAplicacao}" />
    </h:selectOneMenu>that calls this event in my backing bean class:
    public void idiomaAplicacaoMudado(ValueChangeEvent e)
        fIdiomaAplicacao.liberarItens();
        Idioma idioma = Idioma.deString(e.getNewValue().toString());
        // This line is for JSF
        FacesContext.getCurrentInstance().getViewRoot().setLocale(idioma.localidade());
        // This line is for Tiles
        FacesContext.getCurrentInstance().getExternalContext().getSessionMap().
            put(org.apache.tiles.locale.impl.DefaultLocaleResolver.LOCALE_KEY, idioma.localidade());
    }So, do I have to include another line in the idiomaAplicacaoMudado event above in order for the jsp page load the correct resource bundle? Or what else do I have to do?
    Thank you.
    Marcos

  • How to call BPEL process in JSP page

    Hi
    I am new to BPEL.please help me how to call BPEL process in JSP page.
    Thank You...

    Check this thread ....
    How can i call asyncronous BPEL process from Java Class????
    Tom..

  • How to activate class method???

    Hi All,
    How to activate class method?
    Class Name - CL_HRCE_MASTERSWITCHES
    Method name - CHECK_RELEASED
    In se80 this method is showing red, means it is inactive.
    Please guide me how to turn it to green?
    And there is commented code "*  ce_is_released = true."
    How to uncomment it?
    Is i need to apply access key to do this?
    Regards

    Thanks for reply.
    It means We need to apply access key to uncomment following code in method
    Class:CL_HRCE_MASTERSWITCHES
    method CHECK_RELEASED .
    for pilot customers the functionality is released,
    for all others not to be a pilot customer please check note 520965
    then activate this line here
    ce_is_released = true.
    endmethod.
    Regards

  • Accessing another par file jsp pages

    Hi
    i need to access another par file JSP pages from my par file, what all i need.
    any help is appreciated.
    Thanks,
    Damodhar.

    Gandhi,
    Well..there is a very good article on how to use resources(watever resources u mentioned) of one par inside any other par file on SDN:
    Here is the document:<a href="https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/b3c1af90-0201-0010-c0ac-c8d802d264f0">JSPs, Resources...</a>
    Xml files i worked were not property files of an iview.
    They were application specific xml files.I read these xml files on a different par(or iview).For that matter, they don need not be of type xml,could be any type of resource.
    Regards,
    P.

  • [svn] 4492: Simplified how an accessibility class gets hooked into its corresponding component class .

    Revision: 4492
    Author: [email protected]
    Date: 2009-01-12 14:47:10 -0800 (Mon, 12 Jan 2009)
    Log Message:
    Simplified how an accessibility class gets hooked into its corresponding component class.
    We now do the hooking in the static method enableAccessibility(), which is called by code that is autogenerated by the compiler. Previously this method did nothing and the hooking happened at static initialization time. This allows us to remove the static var accessibilityHooked and the static method hookAccessibility() in each accessibility class.
    QE Notes: None
    Doc Notes: None
    Bugs: None
    Reviewer: Deepa and Alex
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AccordionHeaderAccImpl. as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/AlertAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/CheckBoxAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ColorPickerAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ComboBaseAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ComboBoxAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DataGridAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateChooserAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/DateFieldAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/LinkButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/ListBaseAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/MenuBarAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/PanelAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/RadioButtonAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/SliderAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TabBarAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TitleWindowAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/TreeAccImpl.as
    flex/sdk/trunk/frameworks/projects/framework/src/mx/accessibility/UIComponentAccProps.as

    Was it really necessary to post the whole API description?!?
    Locale[] locales = Locale.ENGLISH();ENGLISH is not a method in class Locale, so do not add the braces "( );".
    Also, the constant ENGLISH is not an array, but just a single Locale object.
    You didn't say what your problem was. What do you want to achieve with your program and what is it that you don't understand?

  • How to print new line in jsp page

    hi
    how to print new line in jsp page
    thanks

    \n - new line character is in java specific not HTML
    specific.Well, if the correct line separator sequence (by far not always \n) would be used, it does add a new line to the HTML output. Too bad that you don't want to see HTML but formatted text. The BR tag is a formatting element for the displayed text, not a line break in HTML. ;)

  • How to enable the EL in jsp page

    hi can u tell 'how to enable the EL in jsp page'?

    *I am getting below exception in tomcat when i inclued +<%@ page isScriptingEnabled="true" isELEnabled="true"%>+*
    org.apache.jasper.JasperException: /index.jsp(1,1) Page directive has invalid attribute: isScriptingEnabled
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:198)
         org.apache.jasper.compiler.JspUtil.checkAttributes(JspUtil.java:311)
         org.apache.jasper.compiler.Validator$DirectiveVisitor.visit(Validator.java:106)
         org.apache.jasper.compiler.Node$PageDirective.accept(Node.java:590)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2388)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2394)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2338)
         org.apache.jasper.compiler.Validator.validate(Validator.java:1700)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:178)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

Maybe you are looking for

  • Help with House keeping Archivelog files....!!

    Hi, I am trying to develop a script for housekeeping archive log files. The archives are written to a local disk, then moved to a different location, before being backed up to a tape. The purpose of the script is to identify and move the archive logs

  • How to Transport LSMW to development server to Prodution server

    Hi all, I would like to know how we transport LSMW(project, sub-project, Object) from development server to Production server. Thanks Vipin Nagpal

  • Flash Player in MacBook Pro

    I had the latest flash player when i got the MBP. it was working perfectly till yesterday... now its not woring at all. Flash webites will ask a "?" inthe middle of a Quicktime icon. Tried uninstalling the flashplayer using the uninstaller available

  • MBP 2011 / 10.6.7: Not booting from external devices

    Hi everybody, I just bought a brand new MBP 2.3 GHz i7 QC, 8 GB RAM, 500 GB HDD/7.200. After updating to 10.6.7, installing my applications and restoring my libraries and documents, I made a complete backup of Macintosh HD on an external USB HDD usin

  • How can I install wirless network in my little town?

    Hi, I'm living in a little town and I want to establish a wireless network in it, to serve computers owners there. I need to know how can I get started? I suppose that network will offer to its clients the following: 1) Sharing in resources, such as,