File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[liferay] My sample project

 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ankur Srivastav
Ranch Hand
Posts: 57
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does it even hit the database. Did you try to debug the code flow ?
 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
Chrome Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
Eclipse IDE Java PHP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you still facing issue ? Can you put Exception trace ?
 
Anthony Fernandez
Greenhorn
Posts: 8
Chrome Firefox Browser Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic