You have to either make the method a static one,
or instantiate an instance of your class to call
the method.
Jin
> -----Original Message-----
> From: Mick Sullivan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 10:20 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Please Help On Static Reference ........
>
>
> It is a class, a very basic one at that
> Here it is:
>
> package parkingPrice;
>
> public class parkingPricehandler{
> private String thePrice;
>
> public parkingPricehandler() {
> //thePrice = null;
> }
> public void setPrice( String price ) {
> thePrice = price;
> }
> public String getPrice() {
> return thePrice;
> }
> }
>
> Any ideas?
>
>
> ----Original Message Follows----
> From: "Samson, Lyndon [IT]" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> To: "'[EMAIL PROTECTED]'"
> <[EMAIL PROTECTED]>
> Subject: RE: Please Help On Static Reference ........
> Date: Wed, 7 Mar 2001 14:57:58 -0000
>
> Is parkingPriceHandler an instantiated object or a class?
>
>
> -----Original Message-----
> From: Mick Sullivan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 07, 2001 2:48 PM
> To: [EMAIL PROTECTED]
> Subject: Please Help On Static Reference ........
>
>
> Hi all,
> I was wondering could someoone please help me with this error
> im getting.
>
> Im trying to output a value saved from a previous page in a
> text box in a
> new page using the JSP command:
> <INPUT TYPE="TEXT" NAME="price" SIZE="0"
> VALUE="<%=parkingPriceHandler.getPrice()%>">
>
> The function getPrice() is defined in parkingPriceHandler.
> This is the error i get:
> "Can't make static reference to method java.lang.String
> getPrice() in class
> parkingPrice.parkingPricehandler."
>
> Error: 500
> Location: /project/jsp/view_parking_cost.jsp
> Internal Servlet Error:
>
> org.apache.jasper.JasperException: Unable to compile class for
> JSPC:\tomcat\work\localhost_8080%2Fproject\_0002fjsp_0002fview
> _0005fparking_
> 0005fcost_0002ejspview_0005fparking_0005fcost_jsp_30.java:94:
> Can't make static reference to method java.lang.String
> getPrice() in class
> parkingPrice.parkingPricehandler.
> out.print(parkingPricehandler.getPrice() );
> ^
> 1 error
>
> at org.apache.jasper.compiler.Compiler.compile(Compiler.java,
> Compiled
> Code)
> at
> org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java,
> Compiled
> Code)
> at
> org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java,
> Compiled Code)
> at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java,
> Compiled
> Code)
> at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfN
> ecessary(JspSe
> rvlet.java,
> Compiled Code)
> at
> org.apache.jasper.servlet.JspServlet$JspServletWrapper.service
> (JspServlet.ja
> va,
> Compiled Code)
> at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java,
> Compiled Code)
> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java,
> Compiled
> Code)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java, Compiled
> Code)
> at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java,
> Compiled Code)
> at org.apache.tomcat.core.Handler.service(Handler.java, Compiled
> Code)
> at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java,
> Compiled Code)
> at
> org.apache.tomcat.core.ContextManager.internalService(ContextM
> anager.java,
> Compiled Code)
> at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java,
> Compiled Code)
> at
> org.apache.tomcat.service.http.HttpConnectionHandler.processCo
> nnection(HttpC
> onnectionHandler.java,
> Compiled Code)
> at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
> Compiled Code)
> at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
> Compiled Code)
> at java.lang.Thread.run(Thread.java, Compiled Code)
>
> Whats the Story with Static Referencing???
> Please please help coz my project is due up very soon and Im
> dead confused,
> Thanks a million in advance.
>
>
> ______________________________________________________________
> ___________
> Get Your Private, Free E-mail from MSN Hotmail at
http://www.hotmail.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]