aspose file tools*
The moose likes Portals and Portlets and the fly likes [liferay] My sample project Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "[liferay] My sample project" Watch "[liferay] My sample project" New topic
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,
Anthony
Ankur Srivastav
Ranch Hand

Joined: Aug 31, 2009
Posts: 57

Does it even hit the database. Did you try to debug the code flow ?


Sun Certified Java Programmer v 1.4
Oracle Certified Associate, Java SE 7 Programmer
JEE 5 Web Component Developer Certified Professional
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: 57

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: 57

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [liferay] My sample project
 
Similar Threads
AutoTab tabbing two fields if second one has value...
JSP what's wrong with following code?
JSP DataBase Connection
Liferay Portlet: Form Actions
JSP -Class not found Error