| Author |
[liferay] My sample project
|
Anthony Fernandez
Greenhorn
Joined: Sep 21, 2011
Posts: 8
|
|
I am having trouble with my project. I want to create a simple input to output portlet that connects to my database. It will supposedly print out a list of records, but it just says "Request Processed Successfully". What am I doing wrong? I am a complete newbie.
view.jsp
Samportlet.java
I thank for any response,
Bite
|
Slowly but surely moving forward...
|
 |
Ankur Srivastav
Ranch Hand
Joined: Aug 31, 2009
Posts: 45
|
|
|
Does it even hit the database. Did you try to debug the code flow ?
|
 |
Anthony Fernandez
Greenhorn
Joined: Sep 21, 2011
Posts: 8
|
|
Ankur Srivastav wrote:Does it even hit the database. Did you try to debug the code flow ?
It does. I changed the SELECT statement because it erroneous.
It still doesn't display? What am I doing wrong?
|
 |
Ankur Srivastav
Ranch Hand
Joined: Aug 31, 2009
Posts: 45
|
|
One simple observation by looking at the code, just want to make sure you have the if block
if(myResultSet.next())
myDataField1 = myResultSet.getString("acctno");
myDataField2 = myResultSet.getString("fname");
myDataField3 = myResultSet.getString("lname");
System.out.println(myDataField1+" "+myDataField2+" "+myDataField3);
System.out.print("TEST");
I dont see the braces in there ..
|
 |
Anthony Fernandez
Greenhorn
Joined: Sep 21, 2011
Posts: 8
|
|
Ankur Srivastav wrote:One simple observation by looking at the code, just want to make sure you have the if block
if(myResultSet.next())
myDataField1 = myResultSet.getString("acctno");
myDataField2 = myResultSet.getString("fname");
myDataField3 = myResultSet.getString("lname");
System.out.println(myDataField1+" "+myDataField2+" "+myDataField3);
System.out.print("TEST");
I dont see the braces in there ..
Ah yes! I remedied that:
But the problem persists. I saw some code that does not put "System" before the "out", but I always get an error if I don't put "System", even if I imported java.io.*.
|
 |
Ankur Srivastav
Ranch Hand
Joined: Aug 31, 2009
Posts: 45
|
|
|
Are you still facing issue ? Can you put Exception trace ?
|
 |
Anthony Fernandez
Greenhorn
Joined: Sep 21, 2011
Posts: 8
|
|
Ankur Srivastav wrote:Are you still facing issue ? Can you put Exception trace ?
I don't know if I can still find those Exception traces, as I do not know how to find it in the logs, but I finally found out how to output results in my portlet! Thanks for helping!
This is my sample portlet...
-------------------------------------------------------------------
view.jsp
--------------------------------------------------------------------
init.jsp
------------------------------------------------------------------
Samportlet.java
I know this may be crude looking to most of you, but it somehow worked for me.
|
 |
 |
|
|
subject: [liferay] My sample project
|
|
|