Zum Inhalt springen

Java (Beans und JSP)


Empfohlene Beiträge

Geschrieben

Hallo,

habe eine bean erstellt mit get- und set-Methoden.

und sie in eine jsp eingebunden -->

<jsp:useBean name="q" class="de.bla.bla.beans.QuadratBean"></jsp:useBean>

wenn ich sie ausführen will kommt folgender Fehler:

Fehlernachricht:

JSPG0227E:

Bei der Umsetzung von /QuadratBeanJSP.jsp: /QuadratBeanJSP.jsp(13,1) --> JSPG0076E: Das erforderliche Attribut type für JSP-Element jsp:useBean fehlt. wurde eine Ausnahme abgefangen.

was kommt denn bei type hin? :D

gruß alex

Geschrieben
class="package.class"

Instantiates a Bean from a class, using the new keyword and the class constructor. The class must not be abstract and must have a public, no-argument constructor. The package and class name are case sensitive.

type="package.class"

If the Bean already exists in the scope, gives the Bean a data type other than the class from which it was instantiated. If you use type without class or beanName, no Bean is instantiated. The package and class name are case sensitive.

class="package.class" type="package.class"

Instantiates a Bean from the class named in class and assigns the Bean the data type you specify in type. The value of type can be the same as class, a superclass of class, or an interface implemented by class.

s'Amstel

Geschrieben


<jsp:useBean id="q" class="de.bla.bla.beans.QuadratBean" scope="page"></jsp:useBean>



<jsp:setProperty name="q" property="zahl" value="<%=zahl%>" />

Das Quadrat von 

Hatte für die id auch name genommen, deshalb hat es nicht funktioniert!

Gruß Alex

Erstelle ein Benutzerkonto oder melde Dich an, um zu kommentieren

Du musst ein Benutzerkonto haben, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen. Es ist einfach!

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde Dich hier an.

Jetzt anmelden

Fachinformatiker.de, 2024 by SE Internet Services

fidelogo_small.png

Schicke uns eine Nachricht!

Fachinformatiker.de ist die größte IT-Community
rund um Ausbildung, Job, Weiterbildung für IT-Fachkräfte.

Fachinformatiker.de App

Download on the App Store
Get it on Google Play

Kontakt

Hier werben?
Oder sende eine E-Mail an

Social media u. feeds

Jobboard für Fachinformatiker und IT-Fachkräfte

×
×
  • Neu erstellen...