Insert a blog in a jsp

Hi,
I have a web portal made with jsp, and I want to insert comments in this portal. Could anybody tell me a API to do this? Thanks

if you are using a db to keep the info then its easy , you just need to configure your server to save and show the comments.

Similar Messages

  • Insert data into table from JSP page using Entity Beans(EJB 3.0)

    I want to insert data into a database table from JSP page using Entity Beans(EJB 3.0).
    1. I have a table 'FRIENDS', (in Oracle 10g database).
    2. It has two columns, 'NAME' and 'CITY'. Both have datatype strings(varchar2).
    3. Now from a JSP page, having two textfields, 'NAME' and 'CITY', I want to insert data into table 'FRIENDS'.
    4. In between JSP and database is a Entity Bean(EJB 3.0) and a stateless session bean.
    5. I am using JDev as editor.
    Please provide me code ASAP or link with similar example.
    Thank you.
    Anurag

    Hi,
    I am also trying that scenario. So u can
    Post the jsp form data to a Servlet which will act as a Controller.
    In the servlet invoke the business method.
    Similar kind of app is in www.roseindia.net
    Hope this would help u.
    Meanwhile if u get any optimal solution, pls post it.
    Thanks,
    Happy Java Coding.

  • Update/insert/delete in the same JSP

    Dear all,
    i want to develop a same JSP from which can update,delete or insert..is it possible??
    thanks in advance..
    sinar

    The form display is dictated by how you process the submit. I would build the form by using standard html tags. Here is another pseudo example:
    <FORM ACTION="target.jsp" >
    <TABLE>
    <TR>
    <TD>
    DeptNo
    </TD>
    <TD>
    DName
    </TD>
    <TR>
    <%
    int nRow = 0;
    %>
    <jbo:RowsetIterate datasource="ds">
    <%
    // increment the row number
    nRow++;
    String sDeptno = "Deptno" + nRow;
    String sDname = "Dname" + nRow;
    String sRowKey = "RowKey" + nRow;
    %>
    <jbo:Row id="myrow" action="current">
    <TR>
    <TD>
    <input type="text" name="<%=sDeptno%>" value='<jbo:ShowValue dataitem="Deptno" />' />
    </TD>
    <TD>
    <input type="text" name="<%=sDname%>" value='<jbo:ShowValue dataitem="Dname" />' />
    <input type="text" name="<%=sRowKey%>" value='<jbo:ShowValue dataitem="RowKey" />' />
    </TD>
    <TR>
    </jbo:Row>
    </jbo:RowsetIterate>
    <input type="submit" />
    </TABLE>
    </FORM>
    NOTE: This should get you started!!!

  • Blogging example with jsp ?

    anyone built a blogging (web log) interface with jsp
    I suppose i cold find a php example and translate it to jsp

    http://java-source.net/open-source/bloggers/jsp-blog
    What scares me is that I didn't even want this information, but since you asked I just typed "jsp blog" into google.
    /k1

  • Inserting latest blog posts list in Adobe Muse

    How can I insert a list of the latest blog posts when working from Adobe Muse? And is it possible to style the blog directly in Muse?
    At the moment I have styled the blog in Dreamweaver and syncronized it with Business Catalyst, but I'm not going to update the pages in Dreamweaver, so I was hoping it is possible to use Adobe Muse for this purpose instead.
    But the main thing is that I want my front page to display a list of the 3 latest blog post titles.

    CMS features, including blogging, will not be part of the Muse 1.0 release. We intend to add CMS features to Muse in the future, that will work with Adobe's Business Catalyst platform. BC already has CMS features (see http://www.businesscatalyst.com/product-tour/overview for more info), but Muse isn't yet able to take advantage of them natively.
    In the meantime, others have had success embedding blogs into their Muse sites. Take a look at the Jam Session Dani hosted for more info on this:
    Embedding and Styling Blogs / Recorded Wednesday, February 22 (2nd from the bottom)
    http://www.adobekb.com/events.html
    Best regards,
    Corey

  • Error while inserting into ms access using jsp

    i am using the following code to insert values from textboxes into access database
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection(url);
              Statement stmt=con.createStatement();
              //ResultSet rs = null;
              //String sql = ("INSERT INTO co-ords VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ");
              String sql = "INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('" + nam + "','" + lat + "','" + lon + "','"+ latm +"','"+ lonm +"','"+ latmd +"','"+ lonmd +"','"+ latms +"','"+ lonms +"') ";
              out.println(sql);
              stmt.executeUpdate(sql);
    the output i get is
    INSERT INTO co-ords (nam ,lat , lon , latm ,lonm , latmd , lonmd ,latms , lonms) VALUES ('cck','28.656529681148545','77.23440170288086','28','77','39','14','23.508','3.8472') Exception:java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement.
    can somebody help me?

    Simple,
    Some error in your query right. Unable to understand Quotation stuff.
    Well understand it properly else error will follow forever :)
    Without String, Straight Away Values
    stmt1.executeUpdate("insert into Login_Details values('Example','Exmaple')");This is the query with Login_Id Pass_Word String containing the value
    stmt1.executeUpdate("insert into Login_Details values('"+Login_Id+"','"+Pass_Word+"')");Then storing sql as string and pass it in executeUpdate(sql)
    String sql="insert into Login_Details values ('example','example') "String + Values in String
    String sql="insert into Login_Details values ('"+example+"','"+example+"') "Just first it . Hope this reply solve ur SQL EXCEPTIONG
    Sachin Kokcha

  • Inserting new rows in a JSP multi-row page

    Hi all.
    I´ve been implementing a JSP multi-row editable page according to the paper:
    http://www.oracle.com/technology/products/jdev/tips/mills/JSP_Multi_Row_Edits.html
    I noted that the code provided in the example just considers handling updates from the multi-row page, by comparing the existing rows in the ControlBinding rangeSet with the ones that came from the page.
    However, I need the ability to handle new rows from the same multi-row form that came from the page. So how can I achieve this task? What code should I include in the processUpdateModel method to handle new inputs?
    regards.
    Denis

    I think I will have to look inside the JHeadStart source code that extends DataAction, understand how that code works, and finally get the pieces I'm interested in...

  • Dynamically creating table and inserting rows and columns using JSP

    Hi,
    I'm using mysql and JSP to create web interface for my forms/tables. I wanna create the table dynamically depending on the data in the table and for each particualar record. and these values shud be loaded on the form after loading from the databaes as soon as the form loads.
    also i want to have a button which shud add new rows dynamically. and same one for columns.
    how do i calculate the values across the rows on the forms
    I'm new to JSP. Please point me in the right direction...any tutorials or code will be helpful.
    Any help is appreciated.
    Thanks
    Ayesha

    u write the code in sequence:
    1 write jdbs to select count(* )from table
    2 put in array e.g. String doc_no=new String[count];
    3 write jdbs to select * from table with condition
    //for no. of records just write
    for(int j=0;j<(count);j++){
    <% while(rs4.next()){
         doc_no=rs4.getString(2);
                        date1[i]=rs4.getString(3);
         doc_type[i]=rs4.getString(4);
         location[i]=rs4.getString(5);
         cheque[i]=rs4.getString(6);
         rate[i]=rs4.getInt(7);
         deb_qty[i]=rs4.getInt(8);
         cre_qty[i]=rs4.getInt(9);
         deb_amt[i]=rs4.getInt(10);
         cre_amt[i]=rs4.getInt(11);
         i++;
         //rs4.close();
                   for(int j=0;j<(count);j++){
                   System.out.println("Data count= "+j);
                   %>
    <tr>
    <td width="15%"><font size="1"><%=doc_no[j] %></font></td>
    <td width="10%"><font size="1"><%=date1[j] %></font></td>
    <td width="12%"><font size="1"><%=doc_type[j] %></font></td>
    <td width="9%"><font size="1"><%=location[j] %></font></td>
    <td width="9%">
    <div align="left"><font size="1"><%=cheque[j] %></font></div>
    </td>
    <td width="8%">
    <div align="right"><font size="1"><%=deb_qty[j] %></font></div>
    </td>
    <td width="8%">
    <div align="right"><font size="1"><%=cre_qty[j] %></font></div>
    </td>
    <td width="9%">
    <div align="right"><font size="1"><%=deb_amt[j] %></font></div>
    </td>
    <td width="10%">
    <div align="right"><font size="1"><%=cre_amt[j] %></font></div>
    </td>
    </tr>
    write if there is any specific problem
    bye,
    Samir

  • Insert an anchor in jsp

    Hello !
    I would insert an anchor in a jsp to view it on particular place.
    I've inserted in "page.jsp" :<a name="test"/>
    I called my jsp in JSPDynPage like :
    "page.jsp#test"
    But it doesn't work...
    Could you help me please ?
    Thanks.
    Delphine.

    Hi,
    You insert something like this somewhere in your jsp:
    <script  language="Javascript">
    function somemethod() {
        this.location.href='someurl#someanchor';
    </script>
    It is not tested.
    If you have Javascript errors, look for a yellow triangle in the left bottom of your screen (double click it). In Firefox there is a javascript console.
    Some Javascript resources/references:
    www.w3schools.com/js/default.asp
    javascript-reference.info
    javascript.about.com/od/reference
    Good luck,
    Roelof
    Message was edited by: R. Knibbe

  • Error - '.' expected - while database insert thru JSP & javabeans & JDBC

    I get the following error when i try to compile the below mentioned code in JDEVELOPER 10.1.2
    Error : '.' expected
    ===================
    have error in my code. I am trying to do a simple database insert program using javabeans and jsp. I get a value to be inserted in database through the jsp page in a text box and would like to be inserted into database using beans The connection to database and mysql query are in java file.
    Here is the code.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@ page language="Java" import="java.sql.*" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
    <html>
    <head>
    </head>
    <body>
    <form name="form1" action="beancode" method="POST">
    Emp ID: <input type="text" name ="emplid"> <br><br><br>
    <input type = "submit" value="Submit">
    <jsp:useBean id="sampl" class="beancode" scope="page">
    <jsp:setProperty name="sampl" property="*"/>
    </jsp:useBean>
    </form>
    </body>
    </html>
    I know i might have made a mistake here in using the bean. Here is the java code which does the insert part.
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    * @author Trainees
    public class beancode
    private String employid;
    private Connection con = null;
    private ResultSet rs = null;
    private PreparedStatement st = null;
    /** Creates a new instance of beancode */
    public beancode()
    try
              Class.forName("org.gjt.mm.mysql.Driver");
              Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/sample?user=user&password=password");
    catch(Exception e)
              System.out.println(e.getMessage());
    public void setemployid(String empid)
              employid = empid;
         public String getemployid()
              return (employid);
    public void insert()
    try
    String s1="insert into samp values('"+employid+"')";
    st = con.prepareStatement(s1);
    st.executeUpdate();
    st.clearParameters();
    st.close();
    catch(Exception m)
    }

    It's pretty hard to spot any errors the way it's currently formatted. But, you're trying to call the beancode when submitting your form, but the beancode isn't a servlet. Try to find a working example, run it, and then change it to implement your requirements.
    The following example shows you have to use the jstl sql tags: http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jsps/jstlsql.html. If you want to do an insert when a user submits a form, you need 2 pages. The first will contain your form, the second will insert the record.
    (once you've got that running, look for some examples using an mvc framework, and how to use bind variables with jdbc)

  • Insert blog with DW?

    I'm recent convert from GoLive. Wondering if there is a way
    to insert a blog into a particular directory of the site, within a
    template. Any ideas? My site is static, but I'd like to integrate a
    blog in part of it.

    few folks would have tried to work a dw template into a blog
    script.
    it could possibly be done but YOU would have to do the blog's
    template
    system so it responded to changes with dreamweaver's changes
    to the file.
    The main thing:
    the blog is a script on the server.
    the dreamweaver template is a design time thing. It only
    affects things on
    your computer.
    Here is an answer: there is no way to "place a blog" into a
    site so if you
    make changes to a dreamweaver template, those changes will go
    into every
    page of that blog. Edit the BLOG's template. Outside of
    dreamweaver.
    Understand the code used in those places.
    > Thanks for the response.
    >
    > My question is whether there is a way to place a blog
    within a template, so
    > that it's still linked. Anyone accomplished that?
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • How do I add a blog to my Muse site?

    Is there a widget or something I can throw onto a page and have people post comments?
    Or more importantly, can I just allow my customer to post "News" through In-Browser editing? (Do I just throw a text block on a page and title it, "News" and let them add to it)?
    What if they wanted to add photos to their "News" or "Blog" page?

    You can absolutely insert a blog into your Adobe Muse site. Most instructions for doing this involve creating a WordPress hosted blog, then embedding that into a Muse page with 'Insert HTML', which creates an iframe with your blog inside.
    While embedding an existing blog with an iframe within a Muse page works, it isolates the blog's content from being considered in the main site's SEO, since it's pages are not actually on the site's server.
    The simplest way, and it's very simple, is to install a WordPress, or any other, blog into a folder in your site named 'blog'. Pick a theme that enables you to mimic your main as closely as you care to. Then create a link in your main site's menu to link to the blog folder. Here's an example...
    http://creativeillusions.biz
    You can also use a blank WordPress theme with no header or footer at all - only the blog posts and sidebar(for categories and recent posts, etc.). Use that theme with a locally installed WordPress blog, them embed that blog in an iframe, and you'd have a very functional blog that can perfectly fit your Muse site's theme, since it's header and footer will actually be the ones on your main site. Plus, since it's actually hosted along with your Muse site's files, it's available for the site's SEO.
    For SEO purposes, you'll need to add your blog folder manually to your sitemap.xml. This is a bit of a hassle, since you'll need to add the blog's entry into your sitemap.xml each time that you re-upload your site, since that actually writes a new version of the sitemap.xml over the existing one. Still, it's a very simple way to add a blog to your Muse site.

  • How can i insert the variable value in MS ACCES Query

    i am creating one Query (query1) in MS ACCESS ( like we creaate Tables, Forms and Reports in MS ACCESS ) in this Query i have given 2 constent value in BETWEEN CLAUSE , after that i Created a CROSS QUERY which is based on the privious Query (query1).
    Now i want to insert the variable value using JSP and HTML in to Query(query1).
    Doing this i want to execute the Query (query1) with variable perameters and
    wants to get the risponce form CROSS QUERY.
    In this matter how can i insert the value in Query(query1) using JDBC and JSP.

    The query is
    Select ZMSGMAP.GROUP_CODE as 'group', ZMSDSTATE.STATE_DESC as 'state', ZMSTRN.YRMON, sum(ZMSTRN.CMAQTY) as 'qty' from ZMSDSTATE,ZMSGMAP,ZMSTRN Where ZMSTRN.STATE=ZMSDSTATE.STATE and ZMSTRN.PLANT=ZMSGMAP.PLANT_CODE and ZMSTRN.YRMON between "+p1+" and "+p2+" Group by ZMDGMAP.GROUP_CODE, ZMSDSTATE.STSTE_DESC, ZMSTRN.YRMONUsing this query i m trying to display the risult but the YRMON is displaying in a single column, i want to display it ia seperat columns. here p1 and p2 is YRMON(it is the yer month like 200102), for this solution i have created Cross table Query which is based on uper Query (query1) and design it column wise Display, it is givng the right display, but the problem is this i m not getting the technique throw which i can insert the variable values in to the query1 (which is designed in MS ACCESS).
    u can contact me on [email protected] for more details.

  • How to display total "items" and "amount " in header.jsp in CRM ISA B2B

    Hi,
    I am modifying “header.jsp” in standard CRM ISA B2B application.  Here we have summary of total number of items and total amount but it is coming in to button and for that below code is there in “header.jsp” and it display it as button text.
    if (!ui.homActivated) { %>
    !!" alt="" border="0" height="16" width="20">
    </td>
    <td class="vertical-align-middle" name="miniBasket" value="<isa:translate key="b2b.header.minibasket.default"/>" >
            <form name="basketForm" action="javascript:show_basket();">
         <input class="green" name="miniBasket" type="button" value="<isa:translate key="b2b.header.minibasket.default"/>"/>   
        </form>
    </td>   
    <% } else { %>
    <!-- HOM scenario - minibasket displays collective order -->
    <td  class="vertical-align-middle" align="right">
    !!" alt="" border="0" height="16" width="20">
    </td>
    <td  class="vertical-align-middle" name="miniBasket" value="<isa:translate key="b2b.header.collorder.default"/>">
    <form name="basketForm" action="javascript:show_collective_order();">
        <input class="green" name="miniBasket" type="button" value="<isa:translate key="b2b.header.collorder.default"/>"/>   
    </form>
    </td>
    <% } %>
    Now I want to display total number of items and total amount separately in two different <td> element.
    How I can get total number of items and total amount in “header.jsp” I tried below code but did not get any success.
    Insert below line in “header.jsp” with respective page import statement for class or let me know which class I have to import.
    <%
         HeaderSalesDocument  hdr =
                (HeaderSalesDocument) request.getAttribute(MaintainBasketBaseAction.RK_HEADER);
        ItemList items =
                (ItemList) request.getAttribute(MaintainBasketBaseAction.RK_ITEMS);
    %>
    And then I use
    <td><%= hdr.getNetValue() %></td>
    <td><%= items.size() %></td>
    But it is not printing any thing and header page not display at all.
    Pl. tell me how to get total amount and number of items in header area. Which class or object I have to use here.
    I really appreciated any help from any one.
    Thanks and regards.
    Ashish Patel.

    Hi, I tried another logic. I took value from  Standard button, in which B2B application display total items and amount and I hide this field, to another text element.
    Now I Am breaking that value in words and stored them in array  and then trying to display that array with particular number which contains total item and amount through Java Script on Focus.
    But problem here is, It is not getting updated automatically I have to click on new text files to trigger Onfocus event. How I can achieve effect like as soon as Standard button changes it's value which is now hidden filed my new text box should update automatically.
    Thanks.
    Ashish

  • JSP include directive not working with Tomcat 5.0

    Hi.
    I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
    I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
           version="2.0">
    <jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
    <%@ include file="/jsp/panelpage_header.inc" %>
         <h:outputText value="Welcome!"/>
    <%@ include file="/jsp/panelpage_footer.inc" %>
    </jsp:root>However, when I try to load the page, a compilation error occurrs:
    org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    ...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
    Did anyone see this kind of error before?

    Ok, the solution with jsp:directive.include works,
    if header.inc and footer.inc themselves are well
    formed too. If I understood the concept right this is
    because header and footer are processed during
    request time and therefore interpreted as
    'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
    >
    But: What can I do when these two files define a tag
    that should enclose my current page (for example,
    header opens a panelGrid-Tag, and footer closes it).
    For this case I thought the use of the
    @include-directive would be neccessary to combine the
    three pages during compilation. By this the resulting
    page would be well-formed although header and footer
    are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
    Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
    What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else.

Maybe you are looking for

  • Is there a way to have security with help without buying Roboserver?

    I'm on Robohelp 10, and I publish to Winhelp.  I have 11 different roles from which users can choose from a drop-down.  My managers would like to restrict access to certain of those roles to those people who are allowed to use certain functionality. 

  • Hp pavillion 500-185el graphic card problems after update to windows 8.1

    hallo after i done the Windows 8.1 update my graphic card is giving me some problem. occasionally my desktop become black for 1-2 seconds and the background disappears. I've update all drivers. the problems started after the update to Windows 8.1 gra

  • With the new OVI suite recognize phone device as "...

    The problem started when I updated the OVI suite a couple of days before. With the new OVI suite my phone device (Nokia C5) is recognized as "s60 Handset" and I don't have access to my internal phone memory, but the SD card contents only! I tried to

  • Please Help - "iPod service failed to start...."

    I have an iPod mini. I have Windows XP. I needed to upgrade my iTunes to get a song I really wanted. And this is what happened... -It was 'registering iPod service and a window pops up and says "Could not start service" -I hit "OK" -After a minute or

  • Regarding variant function module in alv

    hi,     could any body tell about the function modules reuse_alv_variant_default_get reuse_alv_variant_f4 reuse_alv_variant_existence            and how to use it.(by giving an example program) Regards, Pavan.