Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
laxman teja
how can i set the values to db and set values from db using service builder
2012. április 25. 2:48
Válasz

laxman teja

Rangsorolás: New Member

Hozzászólások: 20

Csatlakozás dátuma: 2012. április 16.

Legújabb hozzászólások

plz tell me how to insert a value to db and retrieve to a jsp
Jitendra Rajput
RE: how can i set the values to db and set values from db using service bui
2012. április 25. 2:54
Válasz

Jitendra Rajput

Rangsorolás: Liferay Master

Hozzászólások: 575

Csatlakozás dátuma: 2011. január 7.

Legújabb hozzászólások

Use classes generated by service builder.
Use XXXXLocalServiceUtil to add and get data from database.
Ravi Kumar Gupta
RE: how can i set the values to db and set values from db using service bui
2012. április 25. 3:12
Válasz

Ravi Kumar Gupta

Rangsorolás: Liferay Legend

Hozzászólások: 1041

Csatlakozás dátuma: 2009. június 23.

Legújabb hozzászólások

laxman teja
RE: how can i set the values to db and set values from db using service bui
2012. április 25. 23:05
Válasz

laxman teja

Rangsorolás: New Member

Hozzászólások: 20

Csatlakozás dátuma: 2012. április 16.

Legújabb hozzászólások

thanks for your post.....

ya i have done every thing what u explained but my jsp is not displaying with text boxes and submit button ..... and where to retrieve the values from database
Ravi Kumar Gupta
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 2:37
Válasz

Ravi Kumar Gupta

Rangsorolás: Liferay Legend

Hozzászólások: 1041

Csatlakozás dátuma: 2009. június 23.

Legújabb hozzászólások

what did you try? can you share your portlet?
laxman teja
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 3:07
Válasz

laxman teja

Rangsorolás: New Member

Hozzászólások: 20

Csatlakozás dátuma: 2012. április 16.

Legújabb hozzászólások

<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
this is my .jsp


<portlet:defineObjects />

<form action='<portlet:actionURL/>' method="post">
<table>
<tr>
<td>subjectname:</td>
<td><input type="text" name="subjectname" /></td>
</tr>
<tr>
<td>degree:</td>
<td><input type="text" name="degree " /></td>
</tr>

<tr>
<td colspan=2><input type="submit" value="submit" /></td>
</tr>
</table>
</form>

this is my .java code
package com.test;

import java.io.IOException;
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
import javax.portlet.PortletException;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.ParamUtil;
import com.liferay.util.bridges.mvc.MVCPortlet;
import com.test.model.student;
import com.test.service.studentLocalServiceUtil;

/**
* Portlet implementation class successtruePortlet
*/
public class successtruePortlet extends MVCPortlet {
public void init() {
viewJSP = getInitParameter("view.jsp");

}

public String subjectname;
public Long studentid;
public String degree;





public void processAction(
ActionRequest actionRequest, ActionResponse actionResponse)
throws IOException, PortletException {

long studentid=Long.parseLong(actionRequest.getParameter("studentid"));


String subjectname=actionRequest.getParameter("subjectname");
String degree=actionRequest.getParameter("degree");

actionResponse.setRenderParameter("jspPage","html/successtrueportlet/view.jsp");


try {
studentLocalServiceUtil.addstudent(studentid,subjectname,degree);

} catch (SystemException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}



this is my XXXXlocalserviceimpl

public class studentLocalServiceImpl extends studentLocalServiceBaseImpl {

public student addstudent( long studentid,String subjectname,String degree) throws SystemException
{
student t = new studentImpl();
t = new studentImpl();
t.setStudentId(studentid);

t.setSubjectName(subjectname);
t.setDegree(degree);

return studentPersistence.update(t,false);

}



}



her is my code
but my portlet is displaying without text box and submit button and also tell me were to code for retriving data from database pls helpme!!
Ravi Kumar Gupta
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 3:36
Válasz

Ravi Kumar Gupta

Rangsorolás: Liferay Legend

Hozzászólások: 1041

Csatlakozás dátuma: 2009. június 23.

Legújabb hozzászólások

If you add anything else to jsp.. can you see that?
Hitoshi Ozawa
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 3:42
Válasz

Hitoshi Ozawa

Rangsorolás: Liferay Legend

Hozzászólások: 8000

Csatlakozás dátuma: 2010. március 23.

Legújabb hozzászólások

Can you attach your portlet war file?
laxman teja
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 4:29
Válasz

laxman teja

Rangsorolás: New Member

Hozzászólások: 20

Csatlakozás dátuma: 2012. április 16.

Legújabb hozzászólások

thanks for reply i have .zip file pls go through it
Mellékletek: successtrue-portlet.rar (915,9k)
Hitoshi Ozawa
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 6:36
Válasz

Hitoshi Ozawa

Rangsorolás: Liferay Legend

Hozzászólások: 8000

Csatlakozás dátuma: 2010. március 23.

Legújabb hozzászólások

Tried it. You have an error in your java class.
If you set <portlet-class> value to "com.liferay.util.bridges.mvc.MVCPortlet" jsp will be displayed.
laxman teja
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 21:42
Válasz

laxman teja

Rangsorolás: New Member

Hozzászólások: 20

Csatlakozás dátuma: 2012. április 16.

Legújabb hozzászólások

thanks for your reply it worked ,but when i am entering the values into .jsp it is not stored in database,pls tell me were to write the code for retriving values from database
deepthi narendula
RE: how can i set the values to db and set values from db using service bui
2012. április 26. 22:48
Válasz

deepthi narendula

Rangsorolás: Junior Member

Hozzászólások: 25

Csatlakozás dátuma: 2012. április 26.

Legújabb hozzászólások

how to retrieve data from database and where to write the code for retriving.....pls send me the code snippet..and when i am submitting the values from jsp it is not storing in to database...
Ravi Kumar Gupta
RE: how can i set the values to db and set values from db using service bui
2012. április 27. 0:09
Válasz

Ravi Kumar Gupta

Rangsorolás: Liferay Legend

Hozzászólások: 1041

Csatlakozás dátuma: 2009. június 23.

Legújabb hozzászólások

There are classes created by service builder.. They are XXXLocalServiceUtil.java look at that once, you will find many methods for creating/edit/delete/get etc. Try that once and let us know what is the issue.