Pagination using Struts and jsp
Hi ,
I am newer to this forum. I want pagination example using struts. plz help me
[_Pagination + Struts_|http://www.google.com/search?hl=en&q=pagination+struts&meta=]
Similar Messages
-
File Upload using struts and jsp
Hi,
Anybody have sample coding for uploading files into the database using struts and jsp.
Thanking you in advance for providing the sample coding.
VeenaHi Veena,
In Strutsconfig.xml you have to configure data sources like this
**************strutsconfig.xml******
<data-sources>
<data-source
type="org.apache.common.dbcp.BasicDataSource">
<set-property property="driverClassName"
vlaue="oracle.jdbc.driver.OracleDriver"/>
<set-property property="url" vlaue="jdbcracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID =ORCL)))"/>
<!-- <set-property property="url"
vlaue="jdbcracle:thin:@127.0.0.1:1521:ORCL"/>-->
<set-property property="username"
vlaue="scott"/>
<set-property property="password"
vlaue="tiger"/>
</data-source>
</data-sources>
Now here is how to get data source
public class LookupAction extends Action
public Double getQuote(String symbol,
HttpServletRequest request)
throws Exception
Double price=null;
Connection conn=null;
Statement stmt=null;
ResultSet rs=null;
DataSource dataSource=null;
try
dataSource = getDataSource(request);
conn= dataSource.getConnection();
stmt= conn.createStatement();
rs= stmt.executeQuery("select * from stocks where" + "symbol='" + symbol +"'");
if (rs.next())
=======================
After you can use the coding what I posted earlier.
For that you need to create a table with attachment as a CLOB col.
then with prepared statement I am setting value .
Plz try your self every thing ok you can get that.
all the best
bye
sudheen -
Login Box example and source code on adf struts and JSP
Dear all..
I want to make application using ADF struts and JSP using oracle 10g Jdeveloper.
The user should login into the login box and verify everyone who has right to enter the home.jsp.
Anybody could help me with the source code as well as the step by step explanation...
I'm looking forward the help...http://www.oracle.com/technology/products/jdev/collateral/papers/10g/reviewer/viewlets/reviewer_struts_viewlet_swf.html
-
Urgently!! Deploy project using Struts and Toplink
Hello. I want to make a deploy of a project in wich I'm using Struts and Toplink technologies.
I'm using JDeveloper 10g for Windows and my production server is a SUN V880 with Soloaris 8 and I make it ok, but when I run it since a PC in the intranet the following errors appears (obviously those don't appear before):
java.lang.NullPointerException at org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:309) at jsp.login._jspService(_login.java:50) [SRC:/jsp/login.jsp:5] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:765) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:536)
Thank you so much for help.NOO!! :( I don't install any libraries in the server, but in the WAR file of the application, in the lib folder, there was the jars corresponding. I thought that those libraries, in the WAR file, was "local" to the project, anyway, the Struts and Toplink libraries must be global at server level, 'cause I will use it sure once agian, and now I'm trying to install those in the server...
Thank you so much!! -
When to use servlets and jsp in an application like shoping cart?
Hi All
I m going to design and implement a web application using servelts and jsp. I am still at its requirements analyze stage.
The application is almost likely a shopping cart. So if any of you have the deep knowledge about this domain with servlets and jsp please help me for a good design. What I realy need to know is that
1. what are the core requirements for a shoping cart ?
2. use cases ?
3. best way to follow mvc with servlets and jsp for it?
you can answer to this at the abstract level. no need to go in detail.
if you have any documents like design and use cases mail me to [email protected]
your cooperation is highly appreciated in this regards.Look into this kid
http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/Servlet-Tutorial-Session-Tracking.htm -
Download local file using Servlet and JSP
Hello,
I will like to use a browser to download file on local system using serlvet and Jsp technology. Does anyone have any idea how to do it?
Any comment will be appreciate.
ThanksWell you can just put the file in a folder that is accessible to the web server. Then have a link point to that file. That will cause the web browser to download the file.
hattan -
I am a new servlet programmer.......
iam using tomcat server......
can any one pls help in writing code for file upload using servlets and jsp without using multipart class or any other class like that....
Please URGENT..Slow down! "Urgent" is from your perspective alone. I, myself, am not troubled or worried in the least.
hi ugniss
thanks for ur reply....sorry i was not
y i was not asked not to use multipart class or any
other class like that...is there any other
possibility to do file uploading from jsp to
servlet...
Just as an aside, a JSP is a Servlet. But even if I move beyond that, the question does not make sense. If you want a "JSP to upload to a Servlet", then simply do so in memory. You are still (likely) within the same scope of a given request. However, if instead you are referring to a JSP that is displayed on a browser, then really you are talking about HTML, which is what the browser will receive. And since you are now talking about a browser, your only real, viable option is a multi-part file upload. So, it is either server or it is browser. And either way, the question leads to very established options, as outlined above.
the main concept is.. in the browser the user selects
a particular file and clicks the button upload..after
clicking upload the jsp should sent the file to the
servlet in streams...there the servlet gets in and
saves in a server location........this is wat i hav
to do...
Okay. So, after reading my previous (redundant) paragraph, we have arrived at the crux of the issue. You have a JSP that will be output as HTML to a client (browser) which you want to upload content to your server (handled by a Servlet). So, you are now stuck again with multi-part. The requirement to not use multi-part is non-sensical. You can overcome it, say, if you write your own applet or standalone Swing client. However, if your users are invoking this functionality from a browser, you are limited by the options that W3C has provided you. Use multi-part.
is there aby possibilty to do this.....can any one
pls help....Take the advice to download and review Jakarta Commons FileUpload. Inform your management that their requirement makes no technical sense. Research on your own. There are dozens of examples (and tutorials) on file upload using multi-part. Embrace it. Live it. Love it.
- Saish -
I have some existing jsp application . I want to integrate it with UIX application that is generated from JHeadStart . jsp application is just 10% of whole project.
I am not sure this is a good way or not . May be We should use JHeadstart to generate JSP more than UIX . but I think it 's more powerful if I use JHeadstart to generate UIX application .
What do you recommend for this ?
and if we have to use both together . How dose JSP application pass parameter to UIX application ? and How dose UIX pass parameter to JSP ?. and How UIX use the parameter that 's sent form JSP ?
thanks in advanceIf JSP is only 10% you might want tpo consider migrating these pages to UIX.
If this is not an option, you should be able to use both UIX and JSP pages. However, make sure you create separate struts-config.xml files for the JSP-based subsystem and the UIX-based subsystem. This requires two se[parate ViewController projects, that act as one web application. The same setup that has been aplied to Th JHeadstart demo application in Jhs 10.1.2.1. Check out this article from Duncan Mills as well:
http://www.oracle.com/technology/products/jdev/howtos/10g/StrutsMultiConfigs/struts_multiconfig_howto.html
One addition to this articel: the source path property of the ViewController projects shopuld be the same as well.
As far as communication between the pages is concerned: this is no different then between UIX pages. You can pass request parameters around, and since the pages are running in the same web app, they share the same HttpSession.
Steven Davelaar,
JHeadstart Team. -
How to create an InputSelect using ADF and JSP
I looking for some docs/instructions on creating "an InputSelect using ADF with JSP".
Thanks,
BG...Ok here are the Steps
1) Open the JSP editor for the page in Question.
2) In the Data Control palette select the item that you want to become the poplist and change the "Drop As" poplist to "Single Select List"
3) Drag the field into the page. You'll get an empty poplist which implements the <html:select> and <html:optionsCollection> tags.
4) With the JSP editor still open click on the "UI Model" sub-tab in the Structure pane
5) Select the field you've just dragged in - then right click to get the context menu and choose "edit"
6) Change the List Binding Mode poplist to "LOV Mode"
You're then taken into a couple of screens where you can select the Source VO for the poplist, and the destination dataset, along with the thing you want for the Label and the Value. -
Using Struts and JSTL together
I have
<html:form action="xy.do">
<c:set var="name" value="shalik"/>
<html:text property="name" value="<c:out value="${name}"/>"/>
</html:form>
How could I put data stored in ${name} to show in the text
Also, is there a shorter way to access java variables using jstl core
I would not want to do
<input type="text" name="name" value="<c:out value="${name}"/>"/>
which works, because I have to use strutsNo you can't include tags as attributes to other tags.
Yes, you can definitely use the Struts and JSTL together.
If you want to use EL expressions with the struts tags, it depends on your server.
If you have a JSP2.0 container (eg Tomcat 5) its no problem at all. You can use the EL expressions directly with the standard struts tags.
For a JSP1.2 container, there are specifically written struts-el tags. They let you use EL expressions instead of <%= %> expressions
<c:set var="name" value="shalik"/>
<html:text property="name" value="${name}"/>The struts-el tags only have a subset of the struts tags. It is intended for use with the JSTL. For instance the c:if tag easily replaces a lot of the logic conditional ones (equal, lessThan, etc etc)
The tags are available as part of the standard struts download in the contrib directory.
However for what you seem to be wanting to do, wouldn't it be more struts-like to have an action that specifically populates the action form, and just have
<html:text property="name"/>
The value would then be automagically populated from the form bean.
Hope this helps,
evnafets -
User Authentication using Servlet and JSp
Hi,
I am developing a web app where i need to implement user Authentication to allow members to view and upload files on a certain directory say /data
For this i am using a servlet as a controller which then forwads request to other jsps/servlets based on user response. I tried using servlet mapping in web.xml so that all browser requests would be directed to controller servlet and would branch from there on. However the problem all RequestDispatcher.forward() requests redirected to the servlet putting it in a loop.
Is there another way to achieve this. (Apart from using form-based Basic Authentication).
I am using Resin 1.2.8 servlet/jsp container.
Any response as soon as possible would be appreciated.
Thanks,
KushagraRequestDispatcher.forward() cause the HTTP request to be sent through the request processing flow as if the original request for the resource being forwarded to.
It seems the servlet mapping you are talking about in web.xml should be made more specific. i.e. the mapping should be such that only your so called controller servlet will match up.
You might want to specify the mapping for the controller servlet to be noticeably/effectively different from the mapping for other servlets and JSPs. -
Can we use frames and jsps together..
Is it good to use frames with jsps.performence wise..bcos when iam calling jsps in frames it taking more time..to laod..
regards,Remember, 2 frames == 2 HTTP requests. 3 frames == 3 requests, etc.
It will take longer of course. To think otherwise is crazy. However there are times when the benefits are there. I've used them, expecially if it's a situation where taking a little longer on the initial load makes all other accesses faster. This is particularly the case when I've got a fancy UI that uses lots of graphics. I don't need to load the graphics more than once so I put them in separate frames and only have one frame (which is mostly text) change content. -
How to use servlets and JSP for my homepage?
servlets and JSP are server-side program. If my homepage is on some web-hosting websites, can I upload the servlets and JSP to run it? if possible, where can I find such a web-hosting place?
sraiperNot many hosts offer JSP or Servlet support (and some do but then stop and never give you a refund, grrrrrrr!!!!).
Also, ones that do support it can often be more expensive. There are some free ones but all the one's I've come across have problems that made them unsuitable for my needs.
Here is a list of hosts that support Java:
http://www.thejspbook.com/resources/category.jsp?id=1005&name=JSP+web+hosting
I can't comment on any from that list, however I use http://www.positive-internet.com they are a bit pricey but they have excellent support and are always happy to help with any Tomcat (the JSP/Servlet server they use)configuration issues or needs that you may have. -
I'm supposed to javadoc my application. Can this be done? Any advice or
tips? References to documentation?
Thanks
I tried it out and it doesn't work. The jsp compiler inserts its own
description before the class declaration. The rest of the information
generated by javadoc is pretty much useless. Clearly javadoc and jsps were
never meant to go together. Too bad.
* This code was automatically generated at 11:01:15 AM on Dec 7, 2000
* by weblogic.servlet.jsp.Jsp2Java -- do not edit.
* Copyright (c) 2000 by BEA Systems, Inc. All Rights Reserved.
"Jacob Meushaw" <[email protected]> wrote in message
news:3a2fa46c$[email protected]..
> That is a great question that I have been thinking about myself. Would it
be
> possible to use the "keepgenerated" parameter with the JSPServlet to
> generate the straight java code from the JSPs and then run javadoc on
those?
> Or does the JSPServlet strip out all the comments?
>
> Just an idea,
> -jacob
>
> "Peter Bismuti" <[email protected]> wrote in message
> news:3a2f02c7$[email protected]..
> >
> >
> > I'm supposed to javadoc my application. Can this be done? Any advice
or
> > tips? References to documentation?
> >
> > Thanks
> >
> >
>
>
-
How to list an array of objects using struts in jsp and ActionForm
I am using the struts ActionForm and need to know how to display an Array of objects. I am assuming it would look like this in the ActionForm:
private AddRmvParts addRmv[];
But I am not sure how the getter and setter in the ActionForm should look. Should it be a Collection or an Iterator?
I am thinking I need to use an iterator in the jsp page to display it.
I am also wondering if the AddRmvParts class I have can be the same class that gets populated by the retrieval of data from the database. This class has 10 fields that need to display on the jsp page in 1 row and then multiple rows of these 10 fields.
Thanks.Most probably the easiest way to make it accessible in your page is as a collection.
ie
public Collection getAddRmvParts()
You can use the <logic:iterate> or a <c:forEach>(JSTL) tag to loop through the collection
As long as the individual items in the collection provide get/set methods you can access them with the dot syntax:
Example using JSTL:
<c:forEach var="addRmvPart" items="${addRmvParts}">
<c:out value="${addRmvPart.id} ${addRmvPart.name} ${addRmvPart.description}"/>
</c:forEach>
Maybe you are looking for
-
How can I make Safari and Firefox remember a password?
I changed some of my website passwords recently. In most cases, Safari and Firefox asked me if I wanted them to remember the new password, I said Yes (I'm not on a shared computer), and when I entered my email address or username, it would appear in
-
How To Increase the Size of Memo Fields 4000 Char in WebCenter 11g?
How To Increase the Size of Memo Fields greater than 4000 Char in WebCenter Content (UCM) 11g? I was able to increase the size of Memo field from 2000 Char to 4000 by setting parameter value MEMOFIELDSIZE=4000 . But the requirement is to increase the
-
How to change backgournd image with 7941 phones
Hello, I followed the steps indicated to change the background image on my 7941 phones, but the only image I see when I try to change it on the phone, is the default one. I dont know where to look for answers. I join my list.xml file and the two back
-
-ve time, time recording sys, working hrs entry against prj, PO, SO
Hi Goodmorning, Looking for help please - We are using -ve time management. Time data comes from time recording system and through CATS emp books time against network, service order, production order. Whered does employee swipe data gets recorded in
-
Ever since I upgraded to Firefox 9 on my laptop and Firefox 10 on my desktop (Mac OSX 10.6), I haven't been able to view video on certain sites. I can get youtube and vimeo and hulu no problem. However, it seems I cannot view video on sites where it