Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

About JSP and JavaBean, please help me the "error message"

843840Nov 30 2008 — edited Dec 3 2008
Dears:

Because my first JavaBean will use JGraph,
I modified by the sample from http://www.jgraph.com/faq.html?show=3.2
help me the "error message"

//select.jsp, not whole code
Selected nodes F<input type="text" name="NODE">
<input type="submit" name="run" value="Select">
//view.jsp, not whole code
<!-- For JavaBeans -->
<jsp:useBean id="JGraph" class="bean.GraphLayout" />
<jsp:setProperty name="GraphLayout" property="*" />
<jsp:getProperty name="GraphLayout" property="*" />
//Graphlayout.java
package bean;
...//omit some import, 
public class GraphLayout {
private String NODE; 
public static void main(String[] args) {
...// omit some code about JGraph, 
public String getNODE(){
return NODE;
}

public void setNODE(){
this.NODE=NODE;
}


// Create a Vertex, NODE get from select.jsp 
cells[0] = createVertex( NODE, 20, 20, 40, 20, null, false);
...// omit some code about JGraph, 
}
public static DefaultGraphCell createVertex(String name, double x,
double y, double w, double h, Color bg, boolean raised) {
...// omit some code about JGraph, 
}
{color:#ff0000}//error message
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Syntax error on token "String", @ expected
getNODE cannot be resolved to a type
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement
Syntax error on token "void", @ expected
Syntax error, insert "enum Identifier" to complete EnumHeaderName
Syntax error, insert "EnumBody" to complete BlockStatement
at bean.GraphLayout.main(GraphLayout.java:40){color}

Thanks

Edited by: mjl on Nov 29, 2008 10:42 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2008
Added on Nov 30 2008
17 comments
940 views