How can i render a dynamic html file in jsp page
Hi everybody,
i am trying to render a dynamic html file in jsp page with the result of querying a database.
The response of the query is a xml document. And i have a stylesheet to transfer it to html.
How can i render the html in a jsp file?
I am using below code for HTML files
private var appFile:String="index.html";
if (StageWebView.isSupported)
currentState = "normal";
webView.stage = stage;
webView.viewPort = new Rectangle( 10, 130, (stage.stageWidth)-20, 750 );
var fPath:String = new File(new File("app:/assets/html/aboutus/"+ appFile).nativePath).url;
webView.loadURL(fPath);
addEventListener(ViewNavigatorEvent.REMOVING,onRemove);
else {
currentState = "unsupported";
lblSupport.text = "StageWebView feature not supported";
above code is working fine for me.
Similar Messages
-
How can I print mulitple different .ai files onto one page in Illustrator CS6?
How can I print mulitple different .ai files onto one page in Illustrator CS6? I have all of the files organized by Arrange Documents>Tile All in Grid and I would like to print the files in this format so that they can all be seen at once when printed out onto one page.
Some background is that I have 16 different cad drawings that I have converted and edited in illustrator. I'd like to basically make a contact sheet with all 16 drawings so that they can be reviewed on one sheet of paper after printing. But each drawing is in it's own unique file, and I have not figured out how to put them all onto one page for printing.You can place them (linked) into a new Illustrator file and print from there.
The original files will need pdf compatability. -
How can i hand the RowSet to the next jsp page
In a jsp page, I get a RowSet as the following:
<input type="hidden" name="result" value="<%=ds.getRowSet()%>">
I want to handle with this RowSet in the next jsp page, so
I do in the next jsp page as the following:
<% RowSet rowset = (RowSet)request.getAttribute("result"); %>
But I was told null error. How can i hand the RowSet to the next jsp page.Help. Thanks a lot!Hello Charles,
I did the registration in the same way as in the JDeveloper 3.2.3 (see follows)
// make sure the application is registered
oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "ReefBC_BCPackage_BCPackageModule");
The argument ReefBC_BCPackage_BCPackageModule is a property file (ReefBC_BCPackage_BCPackageModule.properties). After some tries, I can still use it in JDeveloper 9i R2. The reason to keep it is that there would be a lot of migration work of javabean calling if I change it to <job:DataWebBean..>. But I am wondering, do I initialize two application modules when I use registerApplicationFromPropertyFile() and <jbo:ApplicationModule..> in the same page.
The problem in doStartTag() is found after I post "http://forums.oracle.com/forums/thread.jsp?forum=83&thread=155210&tstart=75&trange=15", by tracing into the <jbo:ApplicationModule..> after calling the OrdHttpUploadFormData. HtmlServices.getRequestParameters sends back an exception, that breaks the running of the program. It was temperorily solved by extending the ApplicationModuleTag. If <jbo:..> could use the application module initialized by registerApplicationFromPropertyFile(), I guess it may be a better workaround.
Long postings are being truncated to ~1 kB at this time. -
How can i apply this java program for a jsp page?
import java.io.*;
import java.util.*;
public class FileProcessing
//create a vector container for the input variables
Vector variables = new Vector();
//create a vector container for the constants
Vector constants = new Vector();
/*create a string expression container for the equation
as read from the file */
String expression = " ";
//create double result container for the final result
double result = 0;
public boolean processFile(String filename,String delim)
//index for values vector
int num_values = 0;
//index for constants vector
int num_constants = 0;
//current line being read from the external file.
String curline = " ";
//start reading from the external file
try
FileReader fr = new FileReader(filename);
BufferedReader br = new BufferedReader(fr);
while(true)
curline = br.readLine();
if(curline == null)
break;
//determine the type of current interaction
boolean variable = curline.startsWith("input");
boolean constant = curline.startsWith("constant");
boolean equation = curline.startsWith("equation");
boolean output = curline.startsWith("result");
//on input variables
if(variable)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count=0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String inputval = (new String(b)).trim();
variables.add(num_values,inputval);
num_values++;
count++;
// on constant values
if(constant)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==1)
byte b[]= new byte[100];
System.out.println(temp);
System.in.read(b);
String cons = (new String(b)).trim();
constants.add(num_constants,cons);
num_constants++;
count++;
// on equation
if(equation)
StringTokenizer st = new StringTokenizer(curline,delim);
int num = st.countTokens();
int count = 0;
while(st.hasMoreTokens())
String temp = st.nextToken();
if(count==2)
this.expression = temp;
count++;
// now we are ready to evaluate the expression
if(output)
org.nfunk.jep.JEP myparser= new org.nfunk.jep.JEP();
myparser.setAllowAssignment(true);
for(int i=1;i<variables.size()+1;i++)
String name = "arg"+Integer.toString(i);
myparser.addVariable(name,new Double(variables.get(i-1)
.toString()).doubleValue());
for(int i=1;i<constants.size()+1;i++)
String name = "arg" +Integer.
toString(i+variables.size());
myparser.addConstant(name,new Double(constants.get(i-1).toString()));
//output is obtained as follows
myparser.parseExpression(expression);
result = myparser.getValue();
System.out.println("Assay value: "+result);
catch(Exception e)
System.out.println(e.toString());
return true;
public static void main(String[] args)
FileProcessing fp = new FileProcessing();
fp.processFile("input.eqn",":");
}//my text file name is: "input.eqn" (given below)
input:Enter Value1:arg1
input:Enter Value2:arg2
input:Enter Value3:arg3
constant:arg4
constant:arg5
Equation:arg1+arg2+arg3
result:how can i apply this java program for a jsp pagewhy do you want to do this ?
Your program reads from a file on the disk and formats based on a patterm.
Jsp is not intended for such stuff.
ram. -
How can i pass the same parameter from 1 jsp page to many jsp page?
hello.....
how can i actually pass a parameter from 1 jsp file to many other jsp files? pls help......
thanxHi
Save the information which u want to pass to various JSP's inside Session Object.
There is an Object called HttpSession and u can store information inside which other jsp pages within the same domain and same browser instance can use it.
commands which are for ur interests are
<Session Object>.setAttribute("<object name>", <value>);
Example
HttpSession objsession =request.getSession(true); String strName="NEED_HELP":
objSession.setAttribute("Name", strName);
And then u can retreive that information in your n pages.
Read any JSP/Servlet Books and u will know about them
Bye. -
How can i include css in html file when exported
I want the CSS should be included in the html file when exported, how is that posable?
Muse follows its own structure and keeps HTML, CSS and JS code in separate files as and when possible. If you want all that code to be merged into the HTML file itself, then there is no option to force Muse to do that. You can however, add your own CSS code into the HTML page by adding the CSS using either the Insert HTML option or using the HTML for <head> option in Page Properties > Metadata.
Cheers,
Vikas -
OT: How can IPad user save an HTML file to his machine?
A friend wants to save an HTML file to his IPad (not a link to a web URL)
Any help will be appreciatedYou mean browse to the website on an iPad then save it?
Or transfer an HTML file from another device or computer to an iPad?
If the former then:
Try the Atomic web browser for the iPad.
http://itunes.apple.com/us/app/atomic-web-browser-browse/id347929410
There's also a paid app called iSaveWeb in the App Store.
http://itunes.apple.com/us/app/isaveweb-web-pages-saving/id305594530 -
How can I Locate the correct filepath in a jsp page?
In http://localhost:8080/myweb/a.jsp, I will call a java bean file which is locate in http://localhost:8080/myweb/WEB-INF/classes/haha/DBConnection.class. This java file requires to read an external file which locates in http://localhost:8080/myweb/WEB-INF/classes/haha/db.txt
My question is how can I get the correct filepath in this environment?
inputStream = new BufferedReader(new FileReader(????????));
Only this will work
inputStream = new BufferedReader(new FileReader("D:\Program Files\Apache Software Foundation\Tomcat 5.5\db.txt"));
But no one will place the file here, and it is impossible to do this when upload to 3rd party hosting.
Any suggestion? thx.Thx all, in a jsp page, calling this method is fine.
ServletContext s = getServletContext();
String a = s.getRealPath("/");
In a Servlet file, below method is ready to use:
String b = getServletConfig().getServletContext().getRealPath("/");
My problem is, I have a jsp page, which initialize a java bean , this java file is responsible for Database Connection, which will read the external text file to get the login, password and database name. So I won't need to recompile this file every time when I place in different platform with different configuration. I only need to edit the text file is ok.
But How can I get the absolute file path when that jsp page initialize that java bean file? Below is my error, any suggestions are thx.
package sql;
import java.sql.*;
import java.util.ArrayList;
import java.io.FileReader;
import java.io.BufferedReader;
import javax.servlet.*;
import javax.servlet.http.*;
public class DBConnection extends HttpServlet{
public String sql = null;
public Connection con = null;
public Statement statement = null;
public ResultSet rs = null;
private BufferedReader inputStream = null;
private static ArrayList<String> arr = new ArrayList<String>();
public DBConnection(){
String fs = System.getProperty("file.separator");
ServletContext s = getServletContext();
String realpath = s.getRealPath("/");
String filepath = realpath + "WEB-INF"+fs+"Properties"+fs+"db.txt";
try{
inputStream = new BufferedReader(new FileReader(filepath));
String l;
while ((l = inputStream.readLine()) != null) {
arr.add(l);
Class.forName("com.mysql.jdbc.Driver");
this.con = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+arr.get(0)+"?user=" +arr.get(1)+ "&password="+arr.get(2)+"&useUnicode=true&characterEncoding=utf-8");
this.statement = this.con.createStatement();
}catch (Exception e){
System.err.println(e.getMessage());
}finally{
}java.lang.NullPointerException
javax.servlet.GenericServlet.getServletContext(GenericServlet.java:159)
sql.DBConnection.<init>(DBConnection.java:20)
html.ShowCategory.<init>(ShowCategory.java:17)
org.apache.jsp.left_jsp._jspService(left_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
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) -
How Can I Add Pivot Tables of Excel Into JSP Pages
Hello all,
Basing upon a query to database, i wanted to add a Microsoft Excel pivot table functionality in JSP page [with the result of query].
Is it possible to create a Pivot Table in JSP with dynamic data from database ??
Can any body help me in solving this issue ???
Thanks & Regards
KrishnaThere are a few alternatives to doing this (depending on the clients you are serving this page up for).
Going the pure HTML
There is an open source project called JPivot which provides an HTML front end for Pivot Table (using tag libraries)
Going the Microsoft Office route there are a few options:
1) POI HSSF ( http://jakarta.apache.org/poi/index.html) allows you to "update" an existing Pivot table by replacing data values contained in a template pivot table.
2) Use the open source XELEM api (xelem.sourceforge.net) which produces SpreadsheetML (Micorsofts current XML file Format). At present, I don't believe this handles creating a pivot table from scratch (you have to manually create the Pivot Table template, read in the template (with XELEM) and update the data values in the template before writing it out. (the same holds true for POI)
3) Commercially the company I work for (www.workbeans.com) is writing a pure Java Pivot Table API that will allow you to create a Pivot Table in the Excel SpreadsheetML file format from scratch. (supported by Office 2000, XP and 2003). The Pivot table functionality isn't slated until a future release (Oct. 2005), so if you can wait until then we could help you further.
Best,
Eric
M. Eric DeFazio
Application Architect, workbeans
[email protected] -
Dynamic include file in JSP page
<span class="value">Hi
i have index.jsp , this page can include jsp
pages dynamically by passing the name of the page to be included to the
index page with out .jsp , so if i want to include page "code.jsp" i
put: .../index.jsp?page=code , this have to include code.jsp page
i made the following code , but it did not find the file
so can any one help plz ?
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
File f=new File(request.getParameter("page")+".jsp");
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%=request.getParameter("page")+".jsp" %>" />
<%
}else{
out.print("file not exist");
What does the file existing or not really have to do with it?
You can try it like this:
String pg=request.getParameter("page");
if( pg!= null && ! "".equals(pg)){
String webPath = pg + " .jsp";
String realPath = request.getRealPath(webPath);
File f=new File(realPath);
if(f.exists()){
out.print("file exist");
%>
<jsp:include page="<%= webPath %>" />
<%
}else{
out.print("file not exist");
}Alternatively you could try using a request dispatcher:
RequestDispatcher rd = request.getRequestDispatcher(webPath);
if (rd == null){
// doesn't exist
} -
How can I pass a variable value from first jsp page to thired jsp page
In my program ,threr are three jsp pages . I want the first pages's variable value in to thired page .How can I acess.
I used the request.getparameter() ,but when I print the value , null value is getting .request parameters only last for one request.
To save them longer than that you need to save them somewhere.
Couple of alternatives
1 - store them to session
session.setAttribute("username", request.getParameter("username");
2 - create a hidden field on page 2 and store the value from page 1 there. When you submit page2, you can get it on page3 with request.getParameter again.
<input type="hidden" name="username" value="<%= request.getParameter("username") %>"> -
How can I enlarge the graph in a BI JSP Page?
I create a BI JSP Page, the graph is too narrow, so not enough wide. How can I change the sizew of the graph?
Thanks in advance.Read this:
http://help.apple.com/pages/ipad/2.2/#/tana29e86157 -
How Can I speed up the results on my JSP page with the help of Caching.
I am generating a dropdown listbox by merging an xml file with a style sheet(xsl).
This list box comes up fine without any problems. Now, I am adding some advanced
logic to the
style sheet (xsl) to use the same xml file in a more efficient way. This time
the generation
of the list box is taking much longer (upto 25 seconds) although I get the results
I want.
Is there any way I could speedup this process by using weblogics caching. I know
the process is slowing down
due to the code in the stylesheet. Will caching resolve this issue?. I tried
using
<wl:cache> </wl:cache> on the jsp page generating this listbox but found no improvement.
Any help will be very much appreciated.turn off your phone, unplug your router, leace it off for 30 seconds, and then power it back on and turn the iphone back on
-
How can I add an audio media file to my Pages document
I have created a Pages document on my iPad. I can add photos but not audio (there is only a Photos option) So I emailed the document to my desktop and went onto iCloud via Safari. Now i don't see the Media icon (I am in Pages beta if this is relevant). Any suggestions?
I knew about the comment possibility, but as you have said...users would need instruction. This is intended for a controlled environment where I know that everyone will have a device with a microphone. However, the users of the form would have very little experience as this is meant for patients.
-
Old html files (done on Page Mill) do not open in latest Dreamweaver
I have a large website with many html pages, all developed on the old Adobe Page Mill application. When I try to open any of those html pages onto my new Dreamweaver CS5.5 on my new iMac, those html files are not recognized as "openable" (their titles appear in light gray, and clicking on them does not open them. I can't even click and drag them into the Dreamweaver window. How can I open those old html files in Dreamweaver?
May I recommend you to read this article first to get the basics of "Defining a site" in DW.
<http://www.adobe.com/devnet/dreamweaver/articles/first_website_pt1.html>
This article will give you a head start in Working with DW. Page Mill files are simple text file and they should open readily in DW but who knows what has gone with your system that nothing seems to work.
Good luck.
Maybe you are looking for
-
Question I can no longer send or respond to email from my Firefox browser. I closed and sent from Internet explorer and it works fine. What changed? The only thing different this morning, I downloaded Adobe uprade?
-
Windows Vista and Graphical Screen painter (SE51)
Hi, I am using Windows Vista Business Service pack 1. SAP GUI 7.1 with patch 9. When I try to launch a graphical screnn painter tool such as SE51, I am always greeted by a Character screen painter. I have tried all options by changing settings in c
-
Problem in using WS_DELIVERY_UPDATE(updating the deliveries)
Hi Gurus, Iam facing problem i updating the deliveries using the fm WS_DELIVERY_UPDATE..This is the code.. MOVE : lwa_mchb-matnr TO lwa_vbpok-matnr, lwa_mchb-charg TO lwa_vbpok-charg, lwa_mchb-lgort TO lwa
-
Hi All When I open http://<FQDN>:50000/sld the following error occur. Please let me know if have solution, thanks . Error Summary While processing the current request, an exception occured which could not be handled by the application or the framewo
-
Development, quality analysis & production servers
hi, can anyone tell what is the use of Development server, Quality Analysis server & Production Server...pls... tell me what are its uses & where are they used? If we develop any project, it comes under which server? when will we use Production se