Query about building forums using JSP

Hi everybody here . I hope you are fine and you are doing better .
I have a query about JSP ,I see SUN forums here is built using JSP , I want to know What the Probability to build an open source Forum using JSP like those built with PHP For example : PHPBB and other examples .
On other query If there is already Forums built using JSP , What is this Forum ?
Thank you very much at all
Edited by: ahmedhussien on Jun 17, 2009 5:11 PM

Scroll a bit down and check the "powered by" logo.
An alternative is JForum. Just google "java forum software" or something straightforward like that..

Similar Messages

  • Question about speed issues using JSP/JavaBeans/JRun & SQL Server

    Hi. I am a developer for a small software company. About 2 years ago we started development on an E-Commerce platform written in Java. It has administrative tools that are actual applications and also web admins that are jsp pages.
    Every JSP page we have calls java beans, and these java beans then pull information from or put information into our database.
    Our database is SQL server 7.0 and is a relational DB. So, for instance, we have about 100 items, with 15 features each, 3 images, and so its a pretty small database, but it has quite a few rows.
    Now, to pull information straight from our database and spit it out on a jsp page, it takes about 2 seconds, to put information into the database (saving a survey), it takes about 5-10 seconds. To me, this seems like a VERY long time just for a page to load. We have about 7 websites all running on the same server with different instances of JRun 3.0, and that same server is running SQL Server and IIS 5.0.
    Now, without posting our thousands of lines of code, can anyone help me try to figure out where our bottleneck might possibly be? Any help or suggestions would be greatly appreciated
    Anyone that has done something similar, what was your database access time and what did you use to display your pages? (Jrun with IIS or what)
    I'm the last person here (everyone else jumped ship and I wasn't here for the design aspect of this project) and before we bring in a consultant to try to work on this, I was hoping that some of you here could share your insight on any similar projects you may have worked on.
    Thank you very much.

    Make sure that your JDBC code is using connection pooling. You would know this since you would have to set up a DataSource in the JMC.
    Then instead of going through the DriverManager, you would get your Connection from the DataSource object via the InitialContext object.
    If you're already using Connection pooling, verify that the SQL statements are as efficient as possible. That is, make sure they are using indexes in the DBMS. The SQL tracer tool can show any bad performing SQL.
    Lastly, re-index any tables if they are not reindexed on a regular basis. How often you re-index will depend on how often the data changes.
    Good luck ...

  • I am devloping discussion forum using jsp,jscript,sql2005server

    pls help me how to develop online descussion forum, any one know how to develop this forum, and any open source tools or any related information pls sent to me

    Oh, cripes.
    <sigh> Well, have you thought about it at all? No? Didn't think so.
    You have a database connected to a website (which is essentially all a forum is). Your tables could be User (if you need to log in), Post )for a new thread topic) and Reply (for replies to a thread).
    When a User logs in (first thing to do perhaps....along with registering) you can either reply to existing threads or post a new topic. A new topic will enter a title and author (from User....foreign key again) into the Post table and the actual thread with the PostID as a foreign key to the Thread table. The body of the message becomes the first entry for that PostID in the Thread table. Replies simply add new entries to the Thread table automatically passing the PostID into the table. You can also add other cool things like private messages between users, showing top-ten posters, post counts for each user, profiles and graphical avatars and functionality like that
    But since you've not shown any disernable effort, I can't be too bothered to explain everything. Essentially writing web forums is pretty easy with a little database design. Have a think about it and post back.

  • Query about the forum date

    When I browse this forum as a guest, today's date appears as "Mar 2" (and that was yesterday). When I log in, however, the date is given as (the correct) March 3.
    What's up with that?

    When you're browsing as a guest, click on Guest Settings and change the time zone. This information is stored as a browser cookie and not on the server; therefore, it will need to be repeated for each cookie database instance you use. The settings of an account holder are stored on the server.
    (41313)

  • How to create a "Forum" in JSP?

    Dear members,
    I am a new member here.
    Can any one help me providing info- How to create a online Forum using JSP where user can post msg, read archive & send e-mail.
    Specifically I need to know: what r the technologies to be used, where should I get details help/references/examples etc.
    THANKS IN ADVANCE.
    Mamun

    You can download one for free called "Yazd"
    http://yazd.yasna.com/download.jsp
    --Treefrog
    But, to answer your question:
    1. A database (Oracle/MySQL/Access/UDB)
    2. A webserver that supports sendmail (*nix) or SMTP (windows)
    3. A webserver that support JSP/Servlets (Tomcat/iPlanet/WebSphere)

  • Dynamic select using jsp?

    grrrrr............ok so I'm kinda new to this, and just a little frustrated. I'm gonna ramble here, so any time I sound like I don't know what I'm talking about it 's because I don't..correct me. I want to include a bean in a jsp which will buil d a dynamic select box on the fly. That is, connect to an LDAP db and place each value returned in the query in a select box. Now, I can compile and run the bean in my IDE and watch the output in the console. It's correct because I see "<select><option value = hall>hall....</select>". In the buildSelectBox() method I'm using System.out.println to display each line of my select box (is that right?). Now, when I copy the .class file over to the server I was initially getting an error because the bean wasn't found. I resolved that by properly compiling the bean in a package. Problem is that if I call the bean.buildSelect() method in the .jsp nothing comes back. The page is left blank. What in the world is that about? Can someone push me toward a tutorial that can push me in the right direction or sumthin? Why am I having so much trouble with this? Should I be building the select on the jsp?
    regards,
    mat

    Hi!
    If i understand you correctly :-) you are doing not very right things. I don't want it to seem like I'm going to teach you, but:
    The Bean that has buildSelect() method is not a bean at all. Usualy Beans contain getter/setters and accumulate data. If you want to build html code dynamicaly then you should use servlets(Which is not very flexible in your situation, I think), not JSPs. And if you are using JSPs then you have to make Tag which will do this everything.
    Other way is to use Struts framework which is very good and flexible for building web applications - it has it's own tags for many cases. You can make loops in JSPs, use beans and all that stuff.
    Guys will correct me if I missed something.
    Good luck

  • Any good books on web application using JSP/servlet?

    Does anyone know good books on how-to build enterprise web application using JSP/servlet? Aside from the book "Head First JSP/Servlet". Development using Netbeans is more preferrable.

    801264 wrote:
    What about the free web server? JBoss or Glassfish or something else? I prefer web/application server that is fully compatible with JEE6 (unlike Tomcat that can't handle EJB). thanksI'm a JBoss user myself, so naturally I would advise that to you if I were ignorant. I'm not however, so in stead I'll tell you to investigate yourself and see which one you prefer. Nobody is going to tell you which one to use as there is no such thing as a 'better' or 'best' server. Just different servers each with different issues.
    And the community edition of JBoss has had many issues in the past (because Red Hat of course wants to advise you to go to the enterprise platform which ain't cheap), but JBoss 5.1 was a rock solid piece of software that I have had zero problems with (after reading the odd forum or two). JBoss 6 builds on top of JBoss 5.1 and provides the full JEE6 web profile; this means it does NOT provide a certified 'full' JEE6 stack yet. This means nothing however as all the services you may need in an enterprise application are already there.
    BTW: for simple servlet programming, don't neglect Apache Tomcat. Its a lightweight server that just works.

  • How to develop discussion forums using java

    Hi, can any one kindly explain how to develop disccussion forums using java.
    the application is like same as this forum. one post and the replies are come after that. creating new threads.
    any tutuorial is available for this. what is best dabase for this. and which application server is required.

    if you want to use a forum for sum purpose download an opensource forum software and deploy it in a server that support the serverside technology that it uses.
    If you dont want to go through the trouble of installing the the forum software (normally there is a quaita bit of configuration to do). Goole for Free Forum Hosting and you will get plenty of places that hosts forums for you. Since they do the installation you dont have to wory about that part.
    If you really want to develop a forum software first install an existing open source forum or get an account in a free forum hoster and take good look at the forum software and the features that it provides.
    In here you only see the front end of the forum. The back end is much more complicated. You have to define forums and forum groups, you have to define user groups, you have to define which users has access to which forums. who can start topics and who can reply to topics and whgo has read only access. And how to clollect and stor statistics like number of posts by each user. And the list goes on...
    So first take a look at the features in both front and back end of an existing forum software and decide what you want in your software. Then you can design the database to support those features. And then start coding.
    Technicaly you will need to know how to do servlets/JSP and JDBC in order to build a forum. Most important part is you have to do lots of planing.

  • How to upload a file in BPEL Console Using JSP in JDeveloper, please help..

    Please I am new to Jdeveloper and to BPEL Process of OASuite,I want to know , how to upload a file in BPEL process using JSP in Jdeveloper IDE.
    The main aim is first we need to upload a file in JSP , it has to go to BPEL Process & it has to read the file & write the respective file in return to JSP through BPEL Process. Please I am in Urgent need of the Query , please help me ASAP.
    Send to me response Please.....................................

    Hi,
    I thin that you asked the same question before and I premember that I ointed you to the ADF BC developer guide and the SRDemo if your application uses JSF. For plain JSP - if you Google for: JSP and file upload then you find plenty of sources for JSP and Struts.
    The remaining part is how to stiff the file into a BPEL service on the middle tier. For this I recommended to ask your question on the BPEL forum
    BPEL
    Note that the BPEL integration would be easier if it was done on the middle tier and not onthe client
    Frank

  • Error in switching from one database location  to another database location in Crystal Reports using JSP

    Hi,
    Please help me in resolving the issue while changing the database dynamically in crystal reports using JSP. I followed the below link to change DB connection dynamically.
    CRJava Modify DB Location
    Please help me on this.
    While switching from one database to another i found the issue.
    dbController.replaceConnection(oldConnectionInfo, newConnectionInfo,pFields,replaceParams);
    The Error is:
    com.crystaldecisions.sdk.occa.report.lib.ReportSDKException: Subreport does not exist.---- Error code:-2147467259 Error code name:failed
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:2284)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:732)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:166)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:528)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:526)
        at com.crystaldecisions.reports.common.ThreadGuard.syncExecute(SourceFile:102)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.for(SourceFile:524)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:423)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:480)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.int(SourceFile:421)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.request(SourceFile:351)
        at com.businessobjects.sdk.erom.jrc.a.a(SourceFile:54)
        at com.businessobjects.sdk.erom.jrc.a.execute(SourceFile:67)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent$a.execute(SourceFile:716)
        at com.crystaldecisions.proxy.remoteagent.CommunicationChannel.a(SourceFile:125)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.a(SourceFile:537)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.char(SourceFile:220)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.new(SourceFile:240)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.do(SourceFile:452)
        at com.crystaldecisions.proxy.remoteagent.RemoteAgent.if(SourceFile:429)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.performDo(SourceFile:156)
        at com.crystaldecisions.proxy.remoteagent.UndoUnitBase.a(SourceFile:106)
        at com.crystaldecisions.sdk.occa.report.application.an.a(SourceFile:65)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.a(SourceFile:1921)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValues(SourceFile:2237)
        at com.crystaldecisions.sdk.occa.report.application.ParameterFieldController.setCurrentValue(SourceFile:2328)
        at org.apache.jsp.DynamicDB_jsp._jspService(DynamicDB_jsp.java:255)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: com.crystaldecisions.reports.reportdefinition.ReportModificationException: Subreport does not exist.
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.a(SourceFile:229)
        at com.businessobjects.reports.sdk.requesthandler.ParameterRequestHandler.for(SourceFile:214)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1492)
        at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:660)
        ... 47 more
    Any help Appreciated.
    Thanks
    Penchal

    Do you have subreports in your reports?
    If yes, set the connection info for the subreports as well.
    Additionaly refer to the below discussion
    http://scn.sap.com/thread/3153289
    As you are using Crystal reports for ecllipse runtime libraries to build your jsp, you would need to post your dicussions in the below forum to get better response.
    http://scn.sap.com/community/crystal-reports-for-eclipse
    The above space is dedicated for the issues with crystal reports for ecllipse.
    Thanks,
    Prithvi

  • Dynamic Photo Album using JSP

    Hi all,
    I've been having a bit of trouble getting help with my question - I've tried a couple of usenet groups, however don't seem to be asking the right question. So, I'm hoping that some Java forums may be of more relevance. I'm sorry if this is the wrong place, and if there is a better place for me to ask my question if you could tell me where that is, I'ld be greatful.
    I am looking at finding/ making an online dynamic photo album which
    uses JSP. I've seen a lot of examples using PHP and a few online
    albums using Javascript, however those albums using JavaScript are not
    dynamic - the images are hard coded.
    My scenario is this, we have about 6 different events with about 150
    photos each. What I would like to happen is to be able to have a index
    page which lists 10 photos each, and when you click on the photo to be
    taken to a secondary page with a larger image. I would like to do this
    without needing to create 150 dependant pages.
    I understand that we will be looking at using server side technology.
    As our pages already use JSP we don't want to add a second server side
    language (PHP, Pearl etc...) to the equation.
    So does anyone know of a script that may already do this? As I seem to be having no luck in finding one to suit my purpose, I would be happy to create my own script.
    The problem is that I am not too familiar with JSP - though I used to do a fair bit of ASP using VB Script. What I would like is to be pointed into a page that will show me how to create an array with a list of filenames in a given directory (using a Site relative path). From there I should be right, but I can't seem to find any references to how this can be done using JSP (or even Javascript).
    If anyone can help me I would greatly appreciate it.
    Regards
    Linda

    You need to File class, it can produce a list of files in a directory.
    File photodir = new File("c:/path/to/photos");
    File[] photos = photodir.listFiles();
    for(int i = 0; i < photos.length; i++){
    File fp = photos;
    if(fp.isFile()){
    // check to see if it is an image

  • Storing / Retrieving PDF using JSP and Oracle

    Dear All
    I am building web application using Macromedia Dreamweaver , using JSP , Tomcat and Oracle 10gR1.
    I need to build a JSP to upload a PDF file to the database and have a way to retrieve it from the database ,, all through JSP .
    I need hints about the building architecture and how it is done ,, samples of code will be great.
    Thank You Very Much

    Use JSP, Servlet and some third party API (Apache Common File Upload) to store the PDF document in blob column.
    --Balaji S                                                                                                                                                                                                                                                           

  • Resultset paging using jsp

    I am creating a small search program using jsp. I want to know how can I implement paging using JDBC.
    It is very easy using asp. In asp only a specified no. or records can be retrieved from database using combination of PageSize and AbsolutePage properties of Recordset Object.
    In jdbc I think there is no such method available. Do I have to use database base specific options to limit the number of records returned like limit keyword in mysql.
    Only way I can think of is to create a resultset object and store it in session and then use the absolute() method of the resultset object to go to a specific record and then next(). But still all records have to returned by db and have to be kept in memory and not only specific no. of records (e.g 10 per page).
    If I doesn't store the recordset in session then every time this search page is accessed, a new recordset is returned with all records. I then have to determine how many records to skip according to page selected in the query string and then use absolute() method of recordset to go to specific record. And then loop, say ten times to display 10 records. Again when next is clicked same procedure is repeated. Here retrieving all records every time page is accessed is very expensive operation.
    In my case even this isn't possible because I am using jdbc odbc bridge, which is not allowing scrollable resultset and jvm is throwing exception in native code. Without scrollable resultset I cannot know how many records are returned. If I try to count using a loop and resultset's next() then I don't have any way to go back to first record again when I actually want to retrieve records to display. Only other way to count the records is executing query twice which isn't very good as records may have been added or deleted between two calls.
    Am I wrong anywhere above?
    If not then question is, can this be done efficiently with jdbc without using any database specific keywords?
    If yes then which method can be used on a busy web site with huge database.
    --Sukhwinder Singh                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    This may help: http://www.powerobj.com
    providing "advice" in this manner is unethical and unhelpful. if you feel a product you are selling would be good for someone you should at the very least disclose your interest in the selling of said product.
    the blatant ad you posted in the JavaServer Pages forum at least makes it clear that you are selling a product. this post does not make that clear and it really should be.

  • File "E:\sandip\programs\IDS_Server\build\web\abstractsubmission.jsp" not f

    Hi everybody.
    I am using struts1.2.9. Please solve my problem.
    AbstractSubmissionAction class
    saveErrors(request,errors);
    if(errors.isEmpty()){
    return mapping.findForward(SUCCESS);
    return mapping.findForward("failure");
    struts file
    <action input="/abstractsubmission.jsp" name="abstractSubmissionForm" path="/abstractsubmission"
    scope="request" type="struts.action.AbstractSubmissionAction" validate="true">
    <forward name="success" path="/abstactloggedin.jsp"/>
    <forward name="failure" path="/abstractsubmission.jsp"/>
    </action>
    After run, browser shows
    HTTP Status 404 -
    type Status report
    message
    description The requested resource () is not available.
    server log
    File "E:\sandip\programs\IDS_Server\build\web\abstractsubmission.jsp" not found
    Message was edited by:
    SandipGaikwad

    According to your suggestion, it throws java.lang.IllegalArgumentException: Path abstractsubmission.jsp does not start with a "/" character
    struts-config.xml file
    <struts-config>
    <form-beans>
    <form-bean name="abstractLoginForm" type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="username" type="java.lang.String"/>
    <form-property name="password" type="java.lang.String"/>
    </form-bean>
    <form-bean name="abstractUserRegistrationForm" type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="title" type="java.lang.String"/>
    <form-property name="firstname" type="java.lang.String"/>
    <form-property name="lastname" type="java.lang.String"/>
    <form-property name="designation" type="java.lang.String"/>
    <form-property name="company" type="java.lang.String"/>
    <form-property name="street" type="java.lang.String"/>
    <form-property name="area" type="java.lang.String"/>
    <form-property name="city" type="java.lang.String"/>
    <form-property name="state" type="java.lang.String"/>
    <form-property name="country" type="java.lang.String"/>
    <form-property name="pin" type="java.lang.Long"/>
    <form-property name="countryCode" type="java.lang.Integer"/>
    <form-property name="cityCode" type="java.lang.Integer"/>
    <form-property name="fax" type="java.lang.Long"/>
    <form-property name="email" type="java.lang.String"/>
    </form-bean>
    <form-bean name="abstractSubmissionForm" type="org.apache.struts.validator.DynaValidatorForm">
    <form-property name="title1" type="java.lang.String"/>
    <form-property name="firstname1" type="java.lang.String"/>
    <form-property name="lastname1" type="java.lang.String"/>
    <form-property name="title2" type="java.lang.String"/>
    <form-property name="firstname2" type="java.lang.String"/>
    <form-property name="lastname2" type="java.lang.String"/>
    <form-property name="abstracttitle" type="java.lang.String"/>
    <form-property name="theFile" type="org.apache.struts.upload.FormFile"/>
    </form-bean>
    </form-beans>
    <global-exceptions>
    </global-exceptions>
    <global-forwards>
    </global-forwards>
    <action-mappings>
    <action
    input="/abstractlogin.do"
    name="abstractLoginForm"
    path="/abstractlogin"
    scope="session"
    type="struts.action.AbstractLoginAction"
    validate="true"
    >
    <forward name="success" path="/abstactloggedin.jsp"/>
    <forward name="failure" path="/abstractlogin.jsp"/>
    </action>
    <action
    input="/abstractuserregistration.jsp"
    name="abstractUserRegistrationForm"
    path="/abstractuserregistration"
    scope="session"
    type="struts.action.AbstractUserRegistrationAction"
    validate="true"
    >
    <forward name="success" path="/abstractregistrationsuccess.jsp"/>
    <forward name="failure" path="/abstractuserregistration.jsp"/>
    </action>
    <action input="/abstractsubmission.jsp" name="abstractSubmissionForm" path="/abstractsubmission"
    scope="request" type="struts.action.AbstractSubmissionAction" validate="true">
    <forward name="success" path="/abstactloggedin.jsp"/>
    <forward name="failure" path="/abstractsubmission.jsp"/>
    </action>
    <action forward="/abstactsubmission.jsp" path="/AbstractSubmission"/>
    <action
    forward="/abstractlogin.jsp"
    path="/AbstractLogin"
    />
    <action
    forward="/abstractuserregistration.jsp"
    path="/AbstractUserRegistration"
    />
    </action-mappings>
    <controller processorClass="org.apache.struts.tiles.TilesRequestProcessor"/>
    <message-resources parameter="com/myapp/struts/ApplicationResource"/>
    <!-- ========================= Tiles plugin ===============================-->
    <!--
    This plugin initialize Tiles definition factory. This later can takes some
    parameters explained here after. The plugin first read parameters from
    web.xml, thenoverload them with parameters defined here. All parameters
    are optional.
    The plugin should be declared in each struts-config file.
    - definitions-config: (optional)
    Specify configuration file names. There can be several comma
    separated file names (default: ?? )
    - moduleAware: (optional - struts1.1)
    Specify if the Tiles definition factory is module aware. If true
    (default), there will be one factory for each Struts module.
    If false, there will be one common factory for all module. In this
    later case, it is still needed to declare one plugin per module.
    The factory will be initialized with parameters found in the first
    initialized plugin (generally the one associated with the default
    module).
    true : One factory per module. (default)
    false : one single shared factory for all modules
    - definitions-parser-validate: (optional)
    Specify if xml parser should validate the Tiles configuration file.
    true : validate. DTD should be specified in file header (default)
    false : no validation
    Paths found in Tiles definitions are relative to the main context.
    -->
    <plug-in className="org.apache.struts.tiles.TilesPlugin" >
    <set-property property="definitions-config" value="/WEB-INF/tiles-defs.xml" />
    <set-property property="moduleAware" value="true" />
    </plug-in>
    <!-- ========================= Validator plugin ================================= -->
    <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
    <set-property
    property="pathnames"
    value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
    </plug-in>
    <!-- ========================= Hibernate plugin ================================= -->
    <plug-in className="struts.plugin.HibernatePlugin">
    <set-property
    property="path"
    value="/hibernate.cfg.xml"/>
    </plug-in>
    </struts-config>
    AbstractSubmissionAction
    public class AbstractSubmissionAction extends Action {
    private ActionMessages errors;
    /* forward name="success" path="" */
    private final static String SUCCESS = "success";
    * This is the action called from the Struts framework.
    * @param mapping The ActionMapping used to select this instance.
    * @param form The optional ActionForm bean for this request.
    * @param request The HTTP Request we are processing.
    * @param response The HTTP Response we are processing.
    * @throws java.lang.Exception
    * @return
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    errors=new ActionMessages();
    SessionFactory factory=null;
    Session session=null;
    String SQL_QUERY;
    Query query;
    DynaValidatorForm dForm=(DynaValidatorForm)form;
    //get file name
    FormFile myFile=(FormFile)dForm.get("theFile");
    String fileName=myFile.getFileName();
    int fileSize=myFile.getFileSize();
    byte[] data=myFile.getFileData();
    if(myFile.getContentType().equals("application/msword")){
    System.out.println("Valid Micrsoft Word file");
    try{
    factory=(SessionFactory)servlet.getServletContext().getAttribute(HibernatePlugin.KEY_NAME);
    session=factory.openSession();
    Transaction transaction=session.beginTransaction();
    //get the server upload directory real path
    String filePath=getServlet().getServletContext().getRealPath("/");
    //save file on the server
    if(!fileName.equals("")){
    System.out.println("Server path:= "+filePath);
    //create file
    File fileToCreate=new File(filePath,fileName);
    //if file does not exist create the file
    if(!fileToCreate.exists()){
    FileOutputStream fileOutputStream=new FileOutputStream(fileToCreate);
    fileOutputStream.write(myFile.getFileData());
    fileOutputStream.flush();
    fileOutputStream.close();
    //get form information
    String title1=(String)dForm.get("title1");
    String firstname1=(String)dForm.get("firstname1");
    String lastname1=(String)dForm.get("lastname1");
    String title2=(String)dForm.get("title2");
    String firstname2=(String)dForm.get("firstname2");
    String lastname2=(String)dForm.get("lastname2");
    String abstracttitle=(String)dForm.get("abstracttitle");
    //get AbstractUserInfoPojo from request
    Cookie[] cookies=request.getCookies();
    long id=Long.parseLong(cookies[0].getValue());
    AbstractUserInfoPojo abstractUserInfoPojo=(AbstractUserInfoPojo)session.get(AbstractUserInfoPojo.class,id);
    AbstractDetailsPojo abstractDetailsPojo=new AbstractDetailsPojo();
    abstractDetailsPojo.setId(id);
    abstractDetailsPojo.setTitle1(title1);
    abstractDetailsPojo.setFirstname1(firstname1);
    abstractDetailsPojo.setLastname1(lastname1);
    abstractDetailsPojo.setTitle2(title2);
    abstractDetailsPojo.setFirstname2(firstname2);
    abstractDetailsPojo.setLastname2(lastname2);
    abstractDetailsPojo.setAbstracttitle(abstracttitle);
    abstractDetailsPojo.setAbstractfilename(fileName);
    abstractDetailsPojo.setAbstractUserInfoPojo(abstractUserInfoPojo);
    abstractUserInfoPojo.setAbstractDetailsPojo(abstractDetailsPojo);
    //save information
    session.save(abstractDetailsPojo);
    session.update(abstractUserInfoPojo);
    //commit the changes
    transaction.commit();
    //pass abstractUserInfoPojo to request
    request.setAttribute("abstractUserInfo",abstractUserInfoPojo);
    }else{
    System.out.println("File already exists");
    }catch(IOException ioe){
    System.out.println("==========IOException :-=============");
    ioe.printStackTrace();
    System.out.println("================================================");
    }catch(SQLGrammarException sge){
    System.out.println("==========SQL Grammer Exception :-=============");
    System.out.println("1> SQL Query= "+sge.getSQL());
    System.out.println("2> Error Code= "+sge.getErrorCode());
    System.out.println("3> SQL State= "+sge.getSQLState());
    SQLException sqe=sge.getSQLException();
    System.out.println("4> Message= "+sqe.getMessage());
    sge.printStackTrace();
    System.out.println("================================================");
    catch (HibernateException e) {
    System.out.print("Hibernate Error");
    e.printStackTrace();
    } finally {
    session.close();
    }else{
    System.out.println("Not a Valid Micrsoft Word file");
    errors.add("Not a Word File",new ActionMessage("errors.abstractfilename"));
    saveErrors(request,errors);
    if(errors.isEmpty()){
    return mapping.findForward(SUCCESS);
    return mapping.findForward("failure");
    }

  • When should we use JSP?

    Hello!
    I have a little general question about JSP because now I'm going to embark upon web development (till today I have been developing native applications). Is JSP used in really big web applications by professionals? I mean, something much bigger than simple forums, rather whole social networkings portals etc? And can JSP fully replace PHP (in practise) in a project or these technologies are rather mixed? Can you give me some examples of web portals developed in JSP? I hesitate between JSP or PHP. I'm familiar with Java and have no experience with PHP. I hope you will help me in making a right decision ;-).
    Kind regards,
    John.

    There are a few big choices for Web development:
    - PHP - long the first choice of teenagers and amateurs, recently with version 5 and frameworks like Symfony, it is maturing.
    - ASP - the Microsoft solution, easy to use, very little structure. A favorite with small business. Recently ASP.Net has provided objects.
    - CGI - used with Perl, this is the grand-daddy of them all, still used, cheap and cheerful, but it doesn't scale well.
    - JEE - Java Enterprise, provides more choices than you can shake a stick at, used by well to do amateurs, students, and big corporations. Hosting for JEE is much more expensive than for the first three, but it is much more powerful.
    ---- JSP - the favorite presentation system for Java servlets. This is a Java version of ASP, by itself it provides little structure
    ---- Velocity, Webmacro and Freemarker - template engines for Java, often run faster than JSP
    ---- Struts - Apache's MVC solution, uses JSP or Velocity for presentation
    ---- Spring MVC - the new system on the block, a big improvement over Struts, still uses JSP and Velocity for presentation
    ---- JSF - Sun's answer to MVC, a component based system like ASP.Net. Provides rapid development at the cost of being tied to forms and tables. Uses a strange version of JSP for presentation. Don't get me started on <verbatim>.

Maybe you are looking for