Fcie.java

Jiří Mareš Jiri.Mares na svt.cz
Středa Říjen 6 13:26:21 CEST 2004


A mate na te uvedene csete (tj. ve WEB-INF/classes/) soubor Fcie.class?

mstevlik na gamo.sk wrote:
> 
>  > Takze je zrejme, ze Fcie neni v zadne package, tj. jakykoliv import vam
>  > nepomuze. Fcie je v defaultni package, tj. ma byt primo ve
>  > WEB-INF/classes/Fcie.class a pouziva se bez importu.
> 
> No problem je, ze mi to nefunguje, vtom jsp nefunguje, bez toho importu, 
> napise mi to pri kompilacii chybu:
> Compiling 1 source file to 
> D:\Develop\Java\Projects\DART\build\generated\classes
> D:\Develop\Java\Projects\DART\build\generated\src\org\apache\jsp\Login2_jsp.java:60: 
> cannot find symbol
> symbol  : variable Fcie
> location: class org.apache.jsp.Login2_jsp
>         Fcie.SessionShow(request, out);
>         ^
> 1 error
> D:\Develop\Java\Projects\DART\nbproject\build-impl.xml:248: The 
> following error occurred while executing this line:
> D:\Develop\Java\Projects\DART\nbproject\build-impl.xml:240: The 
> following error occurred while executing this line:
> D:\Develop\Java\Projects\DART\nbproject\build-impl.xml:91: Compile 
> failed; see the compiler error output for details.
> BUILD FAILED (total time: 10 seconds)
> 
> Stevlik Marian
> ISYS programator
> 
> GAMO a.s.
> Kyjevske nam. 6
> 974 04 Banska Bystrica
> mail: mstevlik na gamo.sk
> tel: +421 48 4137935, 4372111
> ip-tel: 421 48 4372098
> mobil: +421 905 462010
> icq: 38493645
> 
> konference-bounces na java.cz wrote on 06.10.2004 12:12:07:
> 
>  > Takze je zrejme, ze Fcie neni v zadne package, tj. jakykoliv import vam
>  > nepomuze. Fcie je v defaultni package, tj. ma byt primo ve
>  > WEB-INF/classes/Fcie.class a pouziva se bez importu.
>  >
>  > mstevlik na gamo.sk wrote:
>  > >
>  > >  > Uz zde je neco divneho, protoze udajne neexistuje package 
> sk.gamo.DART.
>  > >  > Takze poslete zdrojak te Fcie a uvidime!!
>  > >
>  > > Takze zdrojak Fcie.java
>  > > import java.io.*;
>  > > import java.net.*;
>  > >
>  > > import javax.servlet.*;
>  > > import javax.servlet.http.*;
>  > >
>  > > public class Fcie {
>  > >     public static void SessionShow(HttpServletRequest irRequest,
>  > > PrintWriter irPrinter) {
>  > >         irPrinter.println("Session info");
>  > >         HttpSession lrSession = irRequest.getSession(true);
>  > >         irPrinter.println("GetID = " + lrSession.getId() + "<br>");
>  > >         if (lrSession.isNew())
>  > >             irPrinter.println("IsNew = TRUE" + "<br>");
>  > >         else
>  > >             irPrinter.println("IsNew = FALSE" + "<br>");
>  > >         String lsUserID = (String)lrSession.getAttribute("UserID");
>  > >         if (lsUserID == null) {
>  > >             irPrinter.println("neprihlaseny");
>  > >             lrSession.setAttribute("UserID", "mstevlik");
>  > >         }
>  > >         else
>  > >             irPrinter.println("UserID = " + lsUserID + "<br>");
>  > >         irPrinter.println("<br><br>");
>  > >     }
>  > >
>  > > }
>  > >
>  > > Urobil som teraz to, ze som si nechal vytvorit Java class a povedal 
> som
>  > > pri tvorbe ze ma byt v package "pkgDART"
>  > > Toto je jeho zdrojak:
>  > >
>  > > /*
>  > >  * Fnc.java
>  > >  *
>  > >  * Created on Streda, 2004, október 6, 11:35
>  > >  */
>  > >
>  > > package pkgDART;
>  > >
>  > > /**
>  > >  *
>  > >  * @author  mstevlik
>  > >  */
>  > > import java.io.*;
>  > > import java.net.*;
>  > >
>  > > import javax.servlet.*;
>  > > import javax.servlet.http.*;
>  > >
>  > > public class Fnc {
>  > >     public static void SessionShow(HttpServletRequest irRequest,
>  > > PrintWriter irPrinter) {
>  > >         irPrinter.println("Session info");
>  > >         HttpSession lrSession = irRequest.getSession(true);
>  > >         irPrinter.println("GetID = " + lrSession.getId() + "<br>");
>  > >         if (lrSession.isNew())
>  > >             irPrinter.println("IsNew = TRUE" + "<br>");
>  > >         else
>  > >             irPrinter.println("IsNew = FALSE" + "<br>");
>  > >         String lsUserID = (String)lrSession.getAttribute("UserID");
>  > >         if (lsUserID == null) {
>  > >             irPrinter.println("neprihlaseny");
>  > >             lrSession.setAttribute("UserID", "mstevlik");
>  > >         }
>  > >         else
>  > >             irPrinter.println("UserID = " + lsUserID + "<br>");
>  > >         irPrinter.println("<br><br>");
>  > >     }
>  > >    
>  > > }
>  > >
>  > > Stym ze sa mi v adres.struktura zmenila, prubudli mi tieto subory:
>  > > DART\build\web\WEB-INF\classes\pkgDART\Fnc.class
>  > > DART\src\pkgDART\Fnc.java
>  > >
>  > > Do servletu Login som dopisal:
>  > > import pkgDART.Fnc;
>  > > a zmenil som volanie
>  > > vsetko slape ako ma
>  > >
>  > > Do jsp Login2 som dopisal:
>  > > <%@ page import="pkgDART.Fnc" %>
>  > > a prepisal volanie,
>  > > ale stale to nefunguje :(
>  > >
>  > > Stevlik Marian
>  > > ISYS programator
>  > >
>  > > GAMO a.s.
>  > > Kyjevske nam. 6
>  > > 974 04 Banska Bystrica
>  > > mail: mstevlik na gamo.sk
>  > > tel: +421 48 4137935, 4372111
>  > > ip-tel: 421 48 4372098
>  > > mobil: +421 905 462010
>  > > icq: 38493645
>  > >
>  > > konference-bounces na java.cz wrote on 06.10.2004 11:51:42:
>  > >
>  > >  > > Chyba kt. mi to vyhodi pri kompilacii Login2.jsp:
>  > >  > > Compiling 1 source file to
>  > >  > > D:\Develop\Java\Projects\DART\build\generated\classes
>  > >  > > D:
>  > >  >
>  > > 
> \Develop\Java\Projects\DART\build\generated\src\org\apache\jsp\Login2_jsp.
>  > >  > java:7:
>  > >  > > package sk.gamo.DART does not exist
>  > >  >
>  > >  > Uz zde je neco divneho, protoze udajne neexistuje package 
> sk.gamo.DART.
>  > >  > Takze poslete zdrojak te Fcie a uvidime!!
>  > >  >
>  > >  >
>  > >  > --
>  > >  > Jiří Mareš (mailto:Jiri.Mares na svt.cz)
>  > >  > ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
>  > >  > Czech Republic
>  >
>  > --
>  > Jiří Mareš (mailto:Jiri.Mares na svt.cz)
>  > ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
>  > Czech Republic

-- 
Jiří Mareš (mailto:Jiri.Mares na svt.cz)
ČSAD SVT Praha, s.r.o. (http://www.svt.cz)
Czech Republic


Další informace o konferenci Konference