EL expressions showing up in my jsp textboxes
I am trying to create a simple jsp model 1 architecture example. The application s a jsp page that posts to itself after using a javabean to calculate the roots of the quadratic equation based upon user input values for a, b, and c. However, when I load the page and click the submit button the EL expressions in the jsp file are showing up in the text boxes visable to the user.
Any suggestions?
here is the jsp page:
<jsp:useBean id="lb" scope="page" class="JavaBeans.Quad" />
<jsp:setProperty name="lb" property="*" />
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html>
<body>
<form method="post" action="project1.jsp">
<h1>Quadratic Equation Root Calculator</h1>
<p>This form calculates the quadratic equation roots based upon
the values you provide.</p>
<p><b>Quadratic Equation:</b> ax<sup>2</sup> + bx + c = 0</p>
<p>Enter your values for root calculation below:<br>
<b><label for="a">a</label></b>=<input type="text" id="a" size="1" value="${lb.a}"> <b><label for="b">b</label></b>=<input type="text" id="b" size="1" value="${lb.b}"> <b><label for="c">c</label></b>=<input type="text" id="c" size="1" value="${lb.c}">
<p>
<input type="submit" value="Calculate">
</form>
<p>
<p>Answer: ${lb.r}</p>
<c:if test="{lb.a==0}"><p>Answer: ${lb.r}</p></c:if>
<c:if test="{lb.a>0}"><p>Answer: +/${lb.r}</p></c:if>
</body>
</html>
here is the bean:
package JavaBeans;
import java.util.*;
public class Quad {
int a = 0;
int b = 0;
int c = 0;
double r = 0.0;
public Quad(){
public void setA(int x){
a=x;
calRoots();
public void setB(int x){
b=x;
calRoots();
public void setC(int x){
c=x;
calRoots();
public int getA() {return a;}
public int getB() {return b;}
public int getC() {return c;}
public double getR() {return r;}
private void calRoots(){
double d = Math.pow(b,2)-(4*(a*c));
if (d==0.0) {
r = b/(2*a);
} else {
double r1 = (-b + (Math.sqrt(b))/(2*a));
r = Math.abs(r1);
}
This little line in the jsp file helps:
<%@ page isELIgnored="false" %>
. . . now for figuring out how to post the input to the bean . . .
Similar Messages
-
Airport express shows in Sys Pref but cannot select it
My Airport Express shows in bold as a devise in System Preferences > Sounds> Output, but when I click on it, it will not select, going back to highlight internal speakers.
I can select my Airport Express in iTunes, and it works but I cannot output sound to it in other programs, ie podcasts, online videos, DVDs. I could do this before I upgraded to Mtn Lion.
Running OS X 10.8.2, MacBook Pro 2.53 GHz Intel Core 2 Duo, 4 GB memory.
Thanks,
3pinAirPort Utility for the iPhone, iPad, etc does not support the older version of the AirPort Express that you have.
Try installing AirPort Utility on the Lenovo laptop to see if you can configure the AirPort Express that way.
If the laptop runs XP SP3 or Vista SP2.....use AirPort Utility 5.5.3 for Windows - Support - Apple
Windows 7....use AirPort Utility 5.6.1 for Windows 7 - Support - Apple
Remember that the SB5101 modem must be fully reset before it will associate correctly with the AirPort Express. That means pressing the reset button on the back of the modem (if present) and powering off the modem for at least 30 minutes, then connecting it to the AirPort. -
Airport Express shows constant amber
My Airport Express shows a constant amber. As soon as I plug it in it show's green for about a second and then moves to a solid amber, there's no flashing and it doesn't appear to be searching.
I've tried all the reset options including the factory default where you keep the reset button pressed while you plug it in but all I get is the Amber.
Am I doing something wrong? It is dead??Temporarily connect your Mac via Ethernet directly to the AX. Then you can configure the AX. You may also need to do a hard reset of the AX.
Shouldn't the AX start flashing amber as soon as it's turned on as it's searching for a computer?
The flashing amber indicates the AX hasn't found an Internet connection. It has nothing to do with connecting to any computers. -
Hi,
I have to investigate using Crystal Reports out of our J2EE application.
So I try to find out about versions of Crystal Reports, how we can use them in our environement....
And I'm absolutely stucked with it.
Environment should be BEA WebLogic and an oracle database.
The users of the application should be able to view reports and edit them (if this is possible).
I installed the eval version of Crystal Reporst XI, created an example report with it and now I want to show it on my JSP site
(following the crxi_startup_guide_for_j2ee). Doesn't work because of the error:
com.crystaldecisions.sdk.occa.report.lib.ReportSDKServerException:
There is no server specified.---- Error code:-2147217390 Error code name:serverNotFoundSet up all parameters in the web.xml, CRConfig.xml and clientSDKOptions.xml and nothing...
Am I using a wrong version of Crystal Reports? What else could be wrong? I guess, I'm missing out any point, which could it be?
Any help would be really appreciated!
SteffiHi to All,
I installed the eval version of Crystal Reporst XI, created an example report with it and now I want to call my report from JSF Page.i followed the crxi_startup_guide_for_j2ee.i got the error in 'web.xml' file.the error is:
"cvc-complex-type.2.4.a: Invalid content was found starting with element 'env-entry-value'. One of '{"http://java.sun.com/xml/ns/j2ee":env-entry-type}' is expected"
here i shows my entry in web.xml file:
<env-entry>
<env-entry-name>jdbc/mydatabase name</env-entry-name>
<env-entry-value>!com.microsoft.jdbc.sqlserver.SQLServerDriver!jdbc:odbc:mydatabase name</env-entry-value>
<env-entry-type>java.lang.String</env-entry-type>
</env-entry>
im unable to get what was the problem.my environment is Tomcat 5.0.28,SQL2000.
i created that report using ODBC connection.is it correct?suppose if i have to connect using JNDI means how to achive this?
can any one get me out of this please!!
Thanks in Advance,
--RK -
How to call the method from the java bean and pass it to JSP textbox
i'm quite new to java thats why i'm asking how to call a method in the java bean file and pass it to the JSP textbox. My projects are communicating JSP with C#. i had successfully created a C# client bean file for JSP. The whole process is to type something on the server(C# programming) and it would appear in the textbox.
your question doesn't provide much informartion. provide some other information and coding so that we could tell exactly what you are looking for?
-
Airport Express shows green light but NO Internet
I am using a Macbook Pro and an Airport Express for my Wi-Fi.
I have recently changed my Internet Service Provider. The new ISP provided me with the following information:
1.IP address: 172.100.11.17
2. Subnet mask: 255.255.255.0
3. Default Gateway:172.100.11.1
4. Preferred DNS: 172.16.0.1
5. Alternate DNS: 8.8.8.8
My ISP told me to enter this information manually unlike my previous ISP who used DHCP.
I entered this information by going to system preferences >> Network >> Advanced >> TCP/IP >> Configure IPv4: Using Manually. I also entered the preferred and alternate DNS information under DNS servers in DNS tab.
I applied these settings and the airport express shows solid green light but gives NO access to internet.
I have also tried connecting the Ethernet cable directly to the computer, which also shows connected but gives NO access to Internet.
I borrowed another router from my friend (not apple) and entered the same settings given by my new ISP and boom !!! I got connected to the internet only through wirelessly BUT no connection again using the ethernet.
So I am facing the following problem in Mac OS X (10.7.5)
using
Airport Express: NO internet
Ethernet: NO internet
Other Router(non-apple): Internet works using Wi-fi
Ethernet: NO internet
I do not know if something is blocking the connection or what is happening. I have created new locations (under network) and deleted the old existing one's but nothing seems to help. I also did a hard reset of my Airport Express but nothing seems to help.
Please help me !!!I am using a Macbook Pro and an Airport Express for my Wi-Fi.
I have recently changed my Internet Service Provider. The new ISP provided me with the following information:
1.IP address: 172.100.11.17
2. Subnet mask: 255.255.255.0
3. Default Gateway:172.100.11.1
4. Preferred DNS: 172.16.0.1
5. Alternate DNS: 8.8.8.8
I am able to connect to the internet now directly using ethernet cable but my airport express wouldn't let me connect.
I must be doing something wrong with entering settings in Airport Express. The ISP technician is as clueless as me and had even did some changes under Wi-Fi in the network section on my macbook pro. I dont know if it is causing these problems. I have a few questions, please help.
Q1. While entering the ISP provided details using Airport Utility, which of these should I choose: A. Static B. DHCP C. PPPoE ?
Q2. Should my MAC address in the Airport Utility be set to configure manually or automatically ?
Q3. What should be my Wi-Fi settings in my computer ?. I mean in system preferences under network, should my TCP/IP set as DHCP or manually ? Under hardware tab, there is an option to select MAC address as either Automatically or Manually. What should it be ?
Please Help !!! -
I have Airport Extreme as the base unit and an Express unit in a room separated by a brick wall to improve signal. Express shows a green light indicating signal but my iPad does not perform well. How can I improve other than hardwire ethernet connection?
Other suggestions, and more info about the nature of the problem, may be in this Apple tech note.
http://support.apple.com/kb/HT1365
For example, you might find that the brick wall is not the only problem. There may be other devices pumping out enough wireless interference to be making things even worse.
I agree with Bob Timmons that Ethernet is best and most reliable. And that powerline (which I use) is easier and potentially faster than wireless...but only if your power lines do not have electrical devices plugged in which produce electrical noise on the line. Powerline will be slower than Gigabit Ethernet.
Ethernet cable is the only way to ensure that the signal goes directly there in a shielded way for a clear fast signal. Wireless and powerline are much slower because of all the other things the signal has to fight past to get to the other device. -
My Airport extreme and my airport express are not connecting together. I get an error message saying that my airport express software is not compatible with my Airport extreme and I have use them together for the past five or six years. It says I may need to change my IP address on my computer or something like that but I don't know what to do. the IP address on my express shows 0.0.0.0. Should everything be on the same IP address? Any help would be greatly appreciated. Thank you
Please refer to the information already posted above:
If you see A1084 or A1088 there, your older Express is not supported by the newer version of AirPort Utility that you have.
If you have another Mac running Leopard or Snow Leopard, or a PC, then you could use that computer to administer the older Express and it will work on the network along with the AirPort Extreme.
If the Mac running Leopard or Snow Leopard or PC does not "see" the A1084 Express, you will need to "hard reset" the Express by holding in the reset button for 10 seconds and waiting a full minute for the Express to restart. Then, reconfigure the Express again. -
How to show an image in JSP given the bytes[] of the photo?
Hi all,
I stored a user's picture in the db as text. For this I simply converted the JPG to bytes[] and from bytes to string: Base64.encode(bytes)
Now I wish to do the reverse - to 'output' the image on the screen. So given the bytes[] of the image with
byte[] bytesDB = Base64.decode(userPhotoStr); //userPhotoStr is something like this: /9j/4AAQSkZJRgA...Question: How can I show the image in the JSP page embedded in the page not as download?
I'm using struts with JSP pages.
Thank you!!!!Images in HTML are to be displayed using <img> element. All what an <img> element can take as image is an URL pointing to the image in question.
If the image is dynamic, then you can just let that URL point to some Servlet which takes some request parameter or reads the path info, reads/gets the image as byte array or (much more efficient) as inputstream and writes it to the outputstream of the response.
You may get some ideas out of this: [http://balusc.blogspot.com/2007/04/imageservlet.html].
By the way, massaging the byte array from/to a String is a terribly bad idea. Just store bytes as computer readable bytes, not as human readable characters, this makes completely no sense. Characters on its turn have to be converted to bytes again after all, but now you've let the DB do the work. All with all a performance pain. Bytes > Chars > Bytes > Chars > Bytes instead of just Byes > Bytes. In database you normally use BLOB, BINARY or equivalent for this in combination with JDBC's PreparedStatement#setBinaryStream() and ResultSet#getBinaryStream(). -
Expressions not evaluating properly in jsp:plugin tag
Hi there, running OC4J as Oracle9iAS (1.0.2.2.1)
In the JSP1.1 spec dynamic expressions in the jsp:plugin <param> tag are clearly specified as below:
<jsp:params>
[ <jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" /> ]+ </jsp:params>
Unfortunately, attempting this in OC4J, the expression is simply displayed as a static String, for example the following JSP source:
<jsp:params>
<jsp:param name="rootSubAssembly" value="<%=rootSubAssembly%>" />
</jsp:params>
Would output "<%=rootSubAssembly%>" as the parameter value, rather than the dynamic value specified in the JSP above.
Any ideas? We'd like to benefit from using the plugin tag over object/applet if at all possible.Hi there, running OC4J as Oracle9iAS (1.0.2.2.1)
In the JSP1.1 spec dynamic expressions in the jsp:plugin <param> tag are clearly specified as below:
<jsp:params>
[ <jsp:param name="parameterName" value="{parameterValue | <%= expression %>}" /> ]+ </jsp:params>
Unfortunately, attempting this in OC4J, the expression is simply displayed as a static String, for example the following JSP source:
<jsp:params>
<jsp:param name="rootSubAssembly" value="<%=rootSubAssembly%>" />
</jsp:params>
Would output "<%=rootSubAssembly%>" as the parameter value, rather than the dynamic value specified in the JSP above.
Any ideas? We'd like to benefit from using the plugin tag over object/applet if at all possible. -
Airport Express Shows in WAN, but not Wireless
I have an old Airport Express and a Time Machine (and Powerbook 13" 2011 model ... OSX 10.8.2). I have been using the TM fine for quite some time now. I used to use the AE, but packed it away for the last two years. Having just gotten a new stereo, I would like to play music via the AE again, as I used to.
However now I cannot get the AE to show up in Airport Utility. If I plug it in by Ethernet, it shows up fine and plays music. But the moment I unplug the Ethernet, I lose connection. I have tried to configure as Extend a Network and Join a Network, and the same thing happens with both ... music plays fine with plugged in, but cannot get a signal with wireless. AE does not show up at all on AU on wireless. Resetting the AE has no effect. The AE light is solid green the whole time.
I suspect I am doing something really basically wrong and dumb, but cannot figure it out at all. Any advice would be greatly appreciated.ok here's an update.
now my airport express turns to green automatically (only in my room)
it will still be blinking amber anywhere else
so the problem is still not solved. -
Airport Express shows green, no signal.
So after finally moving into my new apartment, I decided to finally go wireless with my iMac G5 and my girlfriend's eMac G4. We practically skipped into the Apple store, purchased an Airport Express card and two airport extreme cards.
And then it all went downhill. I installed the Extreme card into my iMac and it picked up the signal instantly. Well, this was because the Airport Express was leaning against the unit. If I move the Express even one foot away from my Mac, the signal drops completely. There's nothing. The Express still shows "green" but the signal isn't getting to the iMac at all.
Any thoughts?Most likely problem - when you installed the Airport card into your iMac, you either (a) forgot to attach the internal Airport antenna cable connector to its socket on the Airport card, or (b) you did not FULLY push the connector into its socket, which takes a fair bit of force to do properly.
Review the Airport card installation instructions at:
http://manuals.info.apple.com/en/imacG517inchAirPort.pdf -
Date Expression showing Error in SSRS
Hi,
I have value for Month field as 0. I have used MonthName function in the report. So im getting error as #Error
Expression:
MONTHNAME(Fields!Month.Value)& " "& Fields!Day.Value &" "& Fields!Year.Value
Please help me to resolve the issue.
Thanks in Advance..
Regards,
LuckyAbdulHi,
I want to show if the monthValue = 0 then it should show as N/A or any other. If the monthvalue is 1 to 12 then i need to show as monthname of the monthvalue.
Expression:
MONTHNAME(Fields!Month.Value)& " "& Fields!Day.Value &" "& Fields!Year.Value
Example:
if my monthvalue is 0 then
output should be
N/A
if my monthvalue is 1 then
output should be
January 21 2014
Please help me to resolve the issue.
Thanks in Advance..
Regards,
LuckyAbdul -
I would like to show another web page from a different server in my JSP on Tomcat 6.0.20.
My attempt outputs error message: The requested resource (/show/jsp/http:/mainsite:8500/first/third.cfm) is not available
Here is my attempt:
<jsp:include page="http://mainsite:8500/first/third.cfm" /> Please advise.<jsp:include> can not import pages from other servers. It can only handle local references.
The JSTL <c:import> tag will do this though. -
Show-stopper problem with JSP 2.0 / jstl 1.1
I've just downloaded and installed the jwsdp-1.3 on a windows 2000 machine, and I'm trying my hand at the new JSP stuff. But my first, very basic page has problems. When I try:
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<c:set var="foo" value="value"/>
<c:out value="${foo}"/>
I get the error message: "According to TLD or attribute directive in tag file, attribute value does not accept any expressions", which is stymieing me. I understood from the documentation that this stuff was all integrated into Tomcat 5, and should "just work". Can anyone help?Hi,
The following link should help you.
http://forum.java.sun.com/thread.jsp?forum=45&thread=429838&message=1997980
Maybe you are looking for
-
Error messages in Photoshop CS5
I get this message when I start PS. " There is no disk in the drive. Please insert a disk into the drive\drive\harddisk\dr2" When I accept this message PS continues to load as normal, However If I try to save a file using "Save for Web and Devices"
-
Thrree different times I attempted to download the new OS to my wife's iPad. each time it would proceed to a point somewhere around 80 minutes remaining (started with 3+ hours remaining and downloaded about 4mb per minute). I have a 1mbDSL line tha
-
Making a jtable row noneditable based on a value in a certain cell.
I have a jTable (based on a database table) and one of the columns is OWNER. Is there a way to make an entire row noneditable based on the value in the OWNER column of the currently selected row? Here is the listener code that I have on the jTable. I
-
Re: DAQ write+read analog channels
Thank you Dan, The device used is NI_USB 6211 and the tests will be done by another person. So from your email I understood that is not recommended to use Hardware Timed Single Point. And just for my information: in your example what happened if I w
-
How do you directly post a value to Local Currency 2?
We have a situation where we need to manually revalue a posting. The Company Code currency is $ The Group currency is £ We have a balance that we need to wipe out in £ for our company code. If we use t code F-05 - when we select the document currency