Struts tag for request.setAttribute() in a jsp page
Hello All
Does anyone know struts tag that can be used for request.setAttribute() in a jsp page?
Thanx in advance.
Well
<bean:define id="foo" name="newsIdAttribute" scope="request" type="java.lang.String" />is equivalent to
<%
(java.lang.String) foo = (java.lang.String)request.getAttribute("newsIdAttribute");
%for setting bean properties you might have to use
<jsp:setProperty/> or <c:set/> tags in JSP / JSTL respectively.
Hope this might answer your question :)
REGARDS,
RaHuL
Similar Messages
-
The content type for office excel 2007 in jsp page and the mime-type in we
Hi,
In my system MS Office 2007 is installed. I am trying to generating excel sheets from JSP page by setting the content type "application/vnd.ms-excel" in jsp page and as well as in web.xml file. I am getting the below message
The file you are trying to open, 'xxxxxxxx.xls', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?
Then finally the excel file is opening and displaying properly. If in my system MS Office 2003 is installed , then the above message is not coming.
I have changed the content type according to Excel 2007 <%@ page contentType= "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" %> and in web.xml file the mime type to
<mime-mapping>
<extension>xlsx</extension>
<mime-type>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</mime-type>
</mime-mapping>
even the content type is changed according to office excel 2007 , i am getting the same above message.
My client is asking not to display the above message. So how to prevent that message ?
It's very great if any body reply me as soon as possible.Hi Akash,
I am not using the POI. I am generating the excel sheet using the below code.
<jsp:directive.page import="java.util.Map" />
<jsp:directive.page import="lehman.ra.Report.ReportDefinition" />
<jsp:directive.page import="lehman.ra.RAUtilBean" />
<jsp:directive.page import="java.util.ArrayList" />
<jsp:directive.page import="lehman.util.GeneralUtil" />
<jsp:directive.page import="lehman.admin.report.AdminHtmlReportFormatter"/>
<jsp:directive.page import="lehman.helper.irprod.IRProdHelper"/>
<%@ page contentType= "application/vnd.ms-excel" %>
<jsp:directive.page import="java.util.Iterator"/>
<jsp:directive.page import="java.util.HashMap"/>
<%
String strTradeDate = (String) session.getAttribute("TradingDate");
String sContextPath = request.getContextPath();
IRProdHelper irHelper = new IRProdHelper();
String sReportFormat = "E2E";
String subtab1 = request.getParameter("subtab1");
if (subtab1 == null)
subtab1 ="";
Map report_Ids = (Map) session.getAttribute("ADMIN_E2E_REPORTS");
AdminHtmlReportFormatter formatter = new AdminHtmlReportFormatter();
ArrayList contentData = new ArrayList();
ArrayList headerData = new ArrayList();
ArrayList metaData = new ArrayList();
Map resultMap = null;
String headerString = "";
String contentString = "";
String reportId = "";
int titleSpan = 5;
if( report_Ids!=null && report_Ids.size() > 0){
Object oReportObj = null;
Iterator rowIter = report_Ids.keySet().iterator();
RAUtilBean raUtilBean = new RAUtilBean();
ReportDefinition rdef = new ReportDefinition();
while ( rowIter.hasNext() ){
oReportObj = rowIter.next();
reportId = oReportObj.toString();
System.out.println("**************reportId="+reportId);
resultMap = (HashMap) report_Ids.get(oReportObj);
if(resultMap == null )
continue;
if(resultMap.size() > 0 ) {
contentData = (ArrayList)resultMap.get(GeneralUtil.CONTENT_DATA);
headerData = (ArrayList)resultMap.get(GeneralUtil.COL_METADATA);
metaData = (ArrayList)resultMap.get(GeneralUtil.METADATA);
rdef = new ReportDefinition();
raUtilBean.setReportAttributes(rdef, headerData, metaData,reportId, sReportFormat);
titleSpan = raUtilBean.findMaxCol(contentData, rdef.getDisplayCols());
if("51031".equals(reportId)){
if(resultMap.get("HIDE_ETA")!=null){
boolean hideETA = ((Boolean)resultMap.get("HIDE_ETA")).booleanValue();
formatter.setHideETA(hideETA);
if(hideETA){
titleSpan = titleSpan-1;
rdef.setMaxCol(titleSpan);
headerString = formatter.constructHeadingForE2E(rdef, headerData);
contentString = formatter.constructContentForE2E(rdef, contentData, strTradeDate, sReportFormat);
%>
<html xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>
<meta name="ProgId" content="Excel.Sheet"/>
<meta name="Generator" content="Microsoft Excel 9"/>
<link rel="File-List" href="./Test33_files/filelist.xml"/>
<link rel="Edit-Time-Data" href="./Test33_files/editdata.mso"/>
<link rel="OLE-Object-Data" href="./Test33_files/oledata.mso"/>
<link href="<%=sContextPath %>/llehman.css" rel="stylesheet" type="text/css">
<link href="<%=sContextPath %>/llcontent.css" rel="stylesheet" type="text/css">
<style>
<xsl:comment>
table
{mso-displayed-decimal-separator:"\.";
mso-displayed-thousand-separator:"\,";}
.style0
{mso-number-format:General;
text-align:general;
vertical-align:bottom;
white-space:nowrap;
mso-rotate:0;
mso-background-source:auto;
mso-pattern:auto;
color:windowtext;
font-size:10.0pt;
font-weight:400;
font-style:normal;
text-decoration:none;
font-family:Arial;
mso-generic-font-family:auto;
mso-font-charset:0;
border:none;
mso-protection:locked visible;
mso-style-name:Normal;
mso-style-id:0;}
.xl21
{mso-style-parent:style0;
color:black;
font-size:8.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
border-top:.5pt solid silver;
border-right:.5pt solid silver;
border-bottom:.5pt solid silver;
border-left:none;}
.xl24
{mso-style-parent:style0;
mso-number-format:"\#\,\#\#0\.00_\)\;\\\(\#\,\#\#0\.00\\\)";}
.xl25
{mso-style-parent:style0;
mso-number-format:0%;}
.xl26
{mso-style-parent:style0;
mso-number-format:"\#\,\#\#0_\)\;\\\(\#\,\#\#0\\\)";}
.xl27
{mso-style-parent:style0;
background-color:#666666;
color:#FFFFFF;
font-size:9.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
text-align:left;
vertical-align:middle;
border-top:none;
border-right:.5 pt solid silver;
border-bottom:.5pt silver;
border-left:none;
mso-pattern:auto none;
white-space:normal;
.xl55
color:black;
font-size:8.0pt;
font-weight:700;
mso-style-parent:style0;
mso-number-format:"\#\,\#\#0_\)\;\[Red\]\\\(\#\,\#\#0\\\)";
mso-pattern:auto none;
font-size:9.0pt;
font-family:Arial, sans-serif;
mso-font-charset:0;
text-align:right;
border-top:none;
border-right:.5pt solid silver;
border-bottom:.5pt solid silver;
border-left:none;
.xlDate{
mso-style-parent:style0;
mso-number-format:"yyyy\\-mm\\-dd";
.xlDateTime{
mso-style-parent:style0;
mso-number-format:"yyyy\\-mm\\-dd\\ h\\:mm\\ AM\/PM";
</xsl:comment>
</style>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name><%=subtab1%></x:Name>
<x:WorksheetOptions>
<x:ProtectContents>False</x:ProtectContents>
<x:ProtectObjects>False</x:ProtectObjects>
<x:ProtectScenarios>False</x:ProtectScenarios>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</head>
<body text="#000000" style="margin-left:5px;margin-top:5px">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<table border='0' cellpadding="0" cellspacing='0' width="100%">
<tr class="xl21">
<td align="left" nowrap style='font-size:11px;' colspan="<%=titleSpan%>"><b><%=subtab1%></b> - COB <%=irHelper.formatDate(strTradeDate)%> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td> </td>
</tr>
<!-- Report Processing -->
<tr>
<td>
<%=headerString%>
<%=contentString%>
</td>
</tr>
<%
}//end of if
}//end of while
}//end of if report_Ids
%>
</table>
</body>
</html> -
Tags not recognized when compiling the jsp pages through appc
Hi:
I am trying to convert a web application from weblogic 9.1 to weblogic 10.3. However, when I try to build the ear file the page compilation fails with the error:
weblogic.utils.compiler.ToolFailureException: jspc failed with errors :weblogic.servlet.jsp.CompilationException: projectFinancials.jsp:10:2: The tag handler class was not found "jsp_servlet._tags.__projectJobCostingLayout_tag
However, the tag file is there.
The tags are referenced through this declaration:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<taglib>
<taglib-uri>http://name/app/tagfiles</taglib-uri>
<taglib-location>/WEB-INF/tags</taglib-location>
</taglib>
</web-app>
All the declarations in the jsp pages are fine. In weblogic 9.1 I don't have any problem. I also set the <backward-compatible>true</backward-compatible> in weblogic.xml.
Any idea?
Thanks!There is no need to use tld files with tag files when it comes to running the ear file through appc. When I do development I use a tld file that contains references to all the tag files, however my build process replaces that with the tag files directory:
So, during development I have:
web.xml:
<taglib>
<taglib-uri>http://name/cps/tagfiles</taglib-uri>
<taglib-location>/WEB-INF/tld/mytags.tld</taglib-location>
</taglib>
mytags.tld:
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.0</tlib-version>
<short-name>mytags</short-name>
<uri>mytaglib</uri>
<tag-file>
<name>agreementDetailsLayout</name>
<path>/WEB-INF/tags/agreementDetailsLayout.tag</path>
</tag-file>
During the build I have:
web.xml:
<taglib>
<taglib-uri>http://name/app/tagfiles</taglib-uri>
<taglib-location>/WEB-INF/tags</taglib-location>
</taglib>
If I don't do this appc will have a fit of even bigger proportions (more error messages etc.) -
Please tell the right tool for managing the Version of JSP pages
Hello Friends
We are developing a software for hospital, we need to maintain versioning of the software. Can you give information about the open source version management software
Thanking You
Ajit Sahasubversion is an excellent choice.
% -
Hi,
I have several questions regarding this topic:
1) Does Weblogic 5.1 supports Custom Tags ? If so, are there any known
problems ?
2) Does Weblogic come with any tag libraries (for loops, if, etc) and where
can I get them ?
3) Are there any tag libraries out there (JRun, for example) that have been
successfully run on Weblogic ?
Any help would be much appreciated.
Thanks,
Jamie
As there seems to be general interest, a link would probably be a great
help.
Regards
Daniel Hoppe
-----Original Message-----
From: Michael Girdley [mailto:[email protected]]
Posted At: Friday, August 25, 2000 8:03 AM
Posted To: jsp
Conversation: Custom JSP Tags for Weblogic
Subject: Re: Custom JSP Tags for Weblogic
Please see the documentation:
http://www.weblogic.com/docs51/resources.html
Michael Girdley
BEA Systems Inc
"Jamie" <[email protected]> wrote in message
news:[email protected]...
> Update
> =======
>
> Weblogic Portal has some Tag libraries. I've downloaded the trial
version
> of
> the Weblogic Commerce Server. How do I get the tag libraries and use
them
> on WL 5.1 ?
>
> Answers to original post still wanted
>
> Thanks,
>
> Jamie
>
> Jamie <[email protected]> wrote in message
> news:[email protected]...
> > Hi,
> >
> > I have several questions regarding this topic:
> >
> > 1) Does Weblogic 5.1 supports Custom Tags ? If so, are there any
known
> > problems ?
> >
> > 2) Does Weblogic come with any tag libraries (for loops, if, etc)
and
> where
> > can I get them ?
> >
> > 3) Are there any tag libraries out there (JRun, for example) that
have
> been
> > successfully run on Weblogic ?
> >
> >
> > Any help would be much appreciated.
> >
> > Thanks,
> >
> > Jamie
> >
> >
>
>
-
Help: OJSPC can not compile the JSP with struts tag
Hi,
I am trying to precompile the JSP page with EAR package but OJSPC can not parse the Struts tags.
I always get oracle.jsp.parse.JspParseException:
Error: org.apache.struts.taglib.html.MessgesTei while reading TLD /WEB-INF/tld/struts-html.tld
My OC4J version is 10.1.3.2 and I did tried putting the struts-taglib.jar to /opt/oracle/product/app10g/j2ee/home/jsp/lib or /lib/taglib
but still do not work.
Can anyone tell me how to configure the OJSPC and let it support customerized taglibs?
Thanks a lot!This is a new problem with jdk1.4 when compiling with tomcat.
The solution is to ensure that any classes in WEB-INF/classes are in a package structure and the relevant jsp calls the same using the package name.
best
kev -
Convert jsp page into xml or dom for search
Hello everyone,
I have to build an application that searches for message beans in all jsp page. I did it the traditional way, using scanner and string methods. Its working but its not perfect. So i want to convert all my jsp page into xml format and then process them. My jsp pages are quite complicated. I used some jars that convert them into jspx . But its not working. Please help
Thanks in advanceWell its like this.I need to develop a program that reads all the message bean keys.. We have lots of struts webapps. All messages in the jsp pages have been externalised and internationalised. Now i have to build a program that given a webapp path prints out all the message bean keys used in the webapp. I have developed the program using the Plexus Directory scanner to filter all the jsp pages and java util Scanner to read line by line and used String functions to search for keys.
Now thats not the best soultion. The best way, imo, is to cinvert the jsp into xml pages and then we can parse the xml pages easily. The' problem is to find a way to convert the jsp pages(jstl +javascript) into xml.
Can you help me out?
Thanks -
Struggling on h:inputText tag for date type property
I am struggling to display a simple form which is attached to a bean having a Date type property.
I get the following exception each time I try to access the form, even it does not display as a blank form for the first time access.
Exception:
[#|2008-01-04T14:39:13.500+0530|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_ThreadID=12;_ThreadName=httpWorkerThread-3031-1;_RequestID=676ba2b1-9b5e-4a96-adb5-b1a792507b40;|StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.faces.FacesException: Error performing conversion of value ' of type class java.lang.String to type class java.util.Date for managed bean userBean.
javax.servlet.ServletException: Error performing conversion of value ' of type class java.lang.String to type class java.util.Date for managed bean userBean.The JSP page contains the following tag for the inputText
<h:inputText value="#{userBean.dob}" id="dob" required="true">
<f:convertDateTime pattern="MM/dd/yyyy" />
</h:inputText>
<h:message for="dob" />I want to display a blank form with all the text fields blank.
Any help will be much appreciated.You should be able to do
<h:inputText value="#{bean.lastDate}"/>Where 'bean' is the managed bean name containing
the method getLastDate().
When the view is rendered, the getter (getLastDate())
will be called to display whatever value is returned. -
Syntax problem in JSP page (PDKSTRUTS tag)
I have got a Struts project inside JDev 10.1.2.
Here is a part of my source code project:
<a href="procedure.do?event=DrillDown&procName=<c:out
value=${Row['Name'}"/>">click here
I am deploying this project inside Portal, so I am using PDK-STRUTS tag for
rewriting some specific tags (error, form, a, ...).
This part of source code must be replaced using LINK tag:
<pdkstruts:link action="procedure.do?event=DrillDown&procName=<c:out
value="${Row['Name']}"/>">click here</pdkstruts:link>
The following error message appears at compilation:
Error(31): Attribute: ${Row['Name']}"/ is not a valid attribute name
I think that this is a problem with the "dynamic" part of my link, generated by
<c:out value="${Row['Name']}"/> command.
I have also tried to following: (<c:out value=\"${Row['Name']}\"/>)
Compilation is ok but the <c:out> tag is not interpreted.
The question is : How can I translate this URL for preventing this error and
correctly interpretating the <c:out> tag ?one thing i noticed from your codes, you missed the < ) > character.. try to look at your codes
-
Browse for folder button in JSP Page
Trying to create a browse for folder button in a JSP page. Anybody with some ideas on how to do this? Applet, Bean, some other way? Has anybody done this before? Is it even possible?
Thanks in advance!We have done it with Struts before. Also seen it done with javascript.
-
Retrieving lists from other layer into a JSP page - Design Question
Hi all,
What should be a good design technique in order to allow a JSP page to present some list obtained from other layer of my application. I intend to leave only presentation logic in the JSP layer, while all data access will be in other layer.
For example, I have a JSP page that will show the results of a SQL query originated from an entry form in other JSP page. Let's name them 'search.jsp' and 'result.jsp'
I want that all JDBC access be done in some other layer.
Question 1:
What would be better for this task? A servlet or a bean? (A bean, I suppose?)
Then this bean (?) would have to find some way to pass all the result set into this 'result.jsp'. I think it would be very poor design if I used some Data Object, because it would have to store all rows and pass them at once.
I don't want, either, that the presentation (JSP) layer access directly the data access layer (JDBC, files...). This way, I don't want any JSP page accessing the Resultset object directly.
Question 2:
What do you think could be a good design technique?
I thought of some intermediate layer that provided data objects and data access interfaces. I mean, as my data will come from different sources, like some database (JDBC), some Electronic Document Manager, I thought of having a common access interface, that would provide methods for accessing the resultsets. This could be even a java.util.Enumeration that has a hasMoreElements() method that could be implemented as the next() method from JDBC result sets and the nextElement() method that would actually bring the next row of data.
This way the JSP layer would see only hasMoreElements() and nextElement() methods from the middle layer. On the other hand, the data layer would provide as many different implementations to this access interface (Enumeration?) as there were data sources (JDBC, Files, ...)
Question 3:
What do you think of this design?
Question 4:
Is there any flaw in my approach? Which?
Question 5:
Could you suggest other designs?
I really thank you all, for any kind of answer. I actually use this design for development, however I've never seriously discussed it with someone... this is going to be of great value for me.
Regards,
Filipe FedaltoWell I saw you question and I'll tell you what I do.
I have JSP's which post form data to servlets.
The servlet then calls a factory to produce a ResultContainer (analagous to your lists) which is generated
via JDBC, and/or request parameters etc...
this provides a single point of reference and a "group" of containers (functions really) that can be produced and reused (same container different amount of data)
I also have other static classes which can manipulate the data in the containers
(such as add additional info to the items in the containers) before I forward the container (request attribute)
to the JSP page
Additionally I use Type safe constants for all my HTML form tag names (easier to change and ensure the same name is used everywhere when reading parameters) and again for item statuses
and any other info I need to send along with the page (using Javascript to update the
status to another type safe constant).
I've found that using factories for ResultContainers is very worthwhile and allows you to implement additional servlets extremely quickly (mostly reusing containers that exist) and since the
container is the same for all my JSPs (this may not be the case with you) I can implement JSP's
very quickly as well (just change the view)
btw I refrain from calling my ResultContainer a bean because it is not serializable
I don't know if this will help but at least it gives me a forum to test my ideas
Thanks -
1.i create a database
2.then i create a jsp page for welcome
3.then another jsp page for view result
4.then i write code for java
here is my 1st jsp page
<html>
<head>
<title>login</title>
</head>
<body bgcolor=pink>
<form action="project.jsp" method=post>
Project id
 
; <input type="text" name="proj_id"><br><br>
Project Name <input
type="text" name="proj_name"><br><br>
Client Name
<input
type="text" name="client_name"><br><br>
Project Start Date <input type="text" name="strt_date"><br><br>
Est Project End Date <input type="text" name="est_date"><br><br>
Project Manager <input type="text"
name="proj_mgr"><br><br>
Est Effort
 
; <input type="text" name="est_effort"><br><br>
<input type="submit" name="add" value="Add" onClick=add() >
<input type="button" name="modify" value="Modify">
<input type="button" name="delete" value="Delete">
<input type="button" name="assign" value="Assign">
</form>
</body>
</html>
here my java page
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.*;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.*;
class base
PreparedStatement pstmt=null;
Connection con = null;
Statement stmt = null;
ResultSet rset = null;
int est_effort;
String proj_id,proj_name,client_name,strt_date,est_date,proj_mgr;
/* int est_effort;
String Project_id,Project_name,client_name,start_date,estimated_date,Project_mgr; */
void add( )
try
String driverName = "com.mysql.jdbc.Driver";
Class.forName(driverName);
String serverName = "192.168.10.5";
String mydatabase = "Trainees";
String url = "jdbc:mysql://" + serverName + "/" + mydatabase; // a JDBC url
String username = "josep";
String password = "josep";
con = DriverManager.getConnection(url, username, password);
System.out.println("Connected");
catch(Exception e)
System.err.println("Exception: " + e.getMessage());
try{
System.out.println("Before Update1");
pstmt=con.prepareStatement("insert into project(proj_id,proj_name,client_name,strt_date,est_date,proj_mgr,est_effort) values ('
"+Project_id+" ',' "+Project_name+"',' "+client_name+" ',' "+start_date+" ',' "+estimated_date+" ',' "+Project_mgr+" ',' "+est_effort+"')");
pstmt=con.prepareStatement("insert into project(proj_id,proj_name,client_name,strt_date,est_date,proj_mgr,est_effort) values
System.out.println("Before Update2");
pstmt.setString(1,proj_id);
pstmt.setString (2,proj_name);
pstmt.setString (3,client_name);
pstmt.setString (4,strt_date);
pstmt.setString (5,est_date);
pstmt.setString(6,proj_mgr);
pstmt.setInt(7,est_effort);
pstmt.executeUpdate();
System.out.println("" +pstmt );
catch(Exception e)
System.err.println("Exception: " + e.getMessage());
finally
try
if(con != null)
con.close();
catch(SQLException e)
void modify()
void delete()
void assign()
public class xx extends base
public static void main(String args[]) throws IOException
base a= new base();
a.add();
here my second jsp page
<%@ page language="java"%>
<%@ page import="java.io.*" %>
<%@ page import="java.sql.*"%>
<%@page import="ss.xx"%>
//<%@ page import="ss.xx.*"%>
<html>
<head><title>Welcome</title></head>
<body bgcolor = "LightGrey">
Welcome...
<br>
<%
xx obj=new xx();
obj.add( );
%>
<%
String Project_id = request.getParameter("proj_id");
String Project_name=request.getParameter("proj_name");
String client_name=request.getParameter("client_name");
String start_date=request.getParameter("strt_date");
String estimated_date=request.getParameter("est_date");
String Project_mgr=request.getParameter("proj_mgr");
int est_effort=Integer.parseInt(request.getParameter("est_effort"));
%>
<p><font size="6">Project id : <%= Project_id%></font></p>
<p><font size="6">Project Name : <%= Project_name%></font></p>
<p><font size="6">Client Name : <%= client_name%></font></p>
<p><font size="6">Project Start Date : <%= start_date%></font></p>
<p><font size="6">Est Project End Date : <%= estimated_date%></font></p>
<p><font size="6">Project Manager : <%= Project_mgr%></font></p>
<p><font size="6">Est Effort : <%= est_effort%></font></p>
</body>
</html>
here that second jsp page error
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 12 in the jsp file: /project.jsp
Generated servlet error:
The type base cannot be resolved. It is indirectly referenced from required .class files
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:409)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)Uh, those aren't runtime errors, but just compilation errors. Googling on the error message can give a lot of results.
Learn how to write Java properly. It would also help a lot if you put all the Java logic in Java classes instead of JSPs. -
Refreshing the Content on a JSP page
Hi,
I am developing an application where a JSP page (index.jsp) is displaying some data from the database. There is an HTML form on the JSP page too. When the user fills in the data and clicks submit, he is redirected to a servlet (via form's action)... the servlet inserts the data into the database and the user is redirected back [Response.sendRedirect("index.jsp")] to the original JSP page.
The problem I am facing here is that when the user is back on the original index.jsp page, the newly inserted data is not being displayed on the page. The user MUST refresh the page manually in order to view the new data.
How can I display the new data automatically, without the user refreshing the page?
PS: I have already tried <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">... but it is not working...
Any help will be greatly appreciated.
Thanks.Thanks for info... Have you got any idea of dynamic updation of JSP page? I have been debugging the problem since 2 days and I have tried various methods but nothing seem to help. I have tried to use meta http-equiv and javascript as well for the refresh but its of no use...
My business logic is pretty simple...
index.jsp
=======
[Connect to database]
[Fetch & Display data]
[HTML Form] ---> submit to Servlet 'test'
test.java (Servlet)
======
[Fetch the request parameters sent by JSP page]
[Insert the record into database]
[response.sendRedirect("index.jsp");] -
Hi,
I want to provide internationalization in my web tier by providing locale-specific JSP pages rather than using resource bundles for the content inside the JSP page.
In other words, I'd like to have a folder structure such that I have a default .jsp file in the root folder and locale-specific .jsp files under the locale folders as following:
/jsp
/index.jsp
/en_US/
index.jsp
/en_GB/
index.jspAnd depending on the default locale of the server (not user's). I'd like the appropriate index.jsp to be picked up at runtime.
If the above is not possible, I even wouldn't mind using a locale suffix for the JSP files:
/jsp
/index.jsp
/index_en_US.jsp
/index_en_GB.jspIs there any way to do this?
Thanks, RishabhWell yeah, I did want the server to pick up the "best fit" JSP page automatically, going from specific to general. So if /en_US/index.jsp is missing, it should default to /index.jspSomewhat like how ResourceBundle handles property files.
This approach is suggested in the Designing Enterprise Applications with the J2EE Platform book in the J2EE Internalization and Localization (http://java.sun.com/blueprints/guidelines/designing_enterprise_applications_2e/i18n/i18n4.html) section 10.3.3.5 - Locale-Specific JSP Pages. Of course here they use the users's locale from the request to do this. But using the default locale of the server should pretty much be the same thing.
If the above doesn't really work, can anyone suggest how I can hook into the request handler or write a custom servlet filter as suggested by Ram to do this at a framework level so that it works for all my pages?
Thanks, Rishabh -
Launching a Discoverer report from jsp page
Hi
I have a discoverer workbook created using BI Discoverer (for relational). I want to accept some parameters for this workbook from a jsp page, which will also have a "View report" button. This button when pressed should open up the Discoverer workbook and all the parameters from the jsp should be passed to the workbook.
Is it possible? If yes, any details on it?
We do the same thing successfully to launch Oracle Reports from jsps, we simply build the url in the jsp, and from jsp we submit it to a new window, and it opens up the report. Similar functionality we are looking to launch Discoverer reports.
Any help will be appreciated.
Thanks
ShaluYou can open the workbook with URL parameters with Discoverer Viewer much like you would Oracle Reports. Setting anything form the username, password, workbook name, worksheet, and parameters. All the information can be found in the following document:
http://download-east.oracle.com/docs/cd/B14099_11/bi.1012/b13918/urlstart.htm
The specific question your asking is addressed under 13.5.2 Example 2. Let me know if you have any issues
Matt Topper
Technical Management Consultant
TUSC, The Oracle Experts
[email protected]
Maybe you are looking for
-
SPM Extractors from SAP R/3
Hi, I am quite new working with SPM and currently investigating options for data extraction activity from R/3 to SPM. I could see there is an extraction wiki, were I found very useful information, and could see the main options are: 1. Use SAP provid
-
APPLE'S GOT SOME FLAWS TO WORK OUT!
Everytime I connect my ipod to my computer it takes like 5 mins to do anything and my computer freezes. Then the do not disconnect display comes on and when i try and safely remove it, it says its used by another program?? EXPERIENCED PEOPLE PLEASE H
-
Ierrs on 3C905B over NFS on solaris 8 x86
I have 2 identical Dell PC's, one with Solaris 8 HW 07/01 and one with Solaris 2.6 On the Solaris 8 box, when copying files to local disk over NFS, I get lots of ierrs on the elxl0 devices and the copy is very slow (NFS server is a netapp with gigabi
-
Dell C1765 printer will not make multiple copies in Yosemite
I have installed Yosemite on my mac mini. My Dell C1765 color laser printer will not make multiple copies in Yosemite. It will do so in Windows. Any suggestions?
-
Old Iphone, no SIM, tried to upgrade now bricked
I searched here for this exact issue but found nothing that matched, if it has been asked and answered, my apologies. Got my 3G up and running. Old phone had SIM removed for new. I tried to upgrade the old Iphone to 2.0 and it is now bricked. 911 ser