jsp

Caching with JSP and HTML5: how to disable caching server-side

此生再无相见时 提交于 2021-02-20 04:49:42
问题 I've a Jsp that returns this html 5: <html> <head> <title>Application</title> <!-- Some script includes here --> </head> <body> <!-- My html here --> </body> </html> At the moment the user need to disable caching into the browser, else the old page is reloaded every time. I tried to force no-caching with a scriptlet in that way, but without success: <% response.addHeader("Cache-Control","no-cache"); response.addHeader("Expires","-1"); response.addHeader("Pragma","no-cache"); %> Asde the fact

Caching with JSP and HTML5: how to disable caching server-side

那年仲夏 提交于 2021-02-20 04:49:07
问题 I've a Jsp that returns this html 5: <html> <head> <title>Application</title> <!-- Some script includes here --> </head> <body> <!-- My html here --> </body> </html> At the moment the user need to disable caching into the browser, else the old page is reloaded every time. I tried to force no-caching with a scriptlet in that way, but without success: <% response.addHeader("Cache-Control","no-cache"); response.addHeader("Expires","-1"); response.addHeader("Pragma","no-cache"); %> Asde the fact

Not able to upload large files

流过昼夜 提交于 2021-02-19 08:35:07
问题 I would like to upload large amount of image file (max size 10mb) for that I am using following configuration is struts.xml <interceptors> <interceptor-stack name="fileUploadStack"> <interceptor-ref name="exception" /> <interceptor-ref name="alias" /> <interceptor-ref name="servletConfig" /> <interceptor-ref name="prepare" /> <interceptor-ref name="i18n" /> <interceptor-ref name="chain" /> <interceptor-ref name="debugging" /> <interceptor-ref name="profiling" /> <interceptor-ref name=

Trouble Deploying WAR file. Failed to start component []

落爺英雄遲暮 提交于 2021-02-19 04:01:28
问题 I am currently having an issue deploying a WAR file to my Tomcat7 server (Im new to web dev with java). Everything works great in eclipse but when I generate a WAR file and deploy it to the server I get the following error. "Failed to start component []" Below is the log dump. Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the [] Context cannot be started. at org.apache.catalina.startup

How to choose a value of a HashMap in select Struts2?

回眸只為那壹抹淺笑 提交于 2021-02-19 03:54:26
问题 I ran into a problem with Struts2. I have a HashMap<String, Integer> that I use in a form with a select to choose name and corresponding id to that name. HashMap iterates and populates my <select> list with names. I only need an id to pick. How do I pick an id/value instead of a name/key? companyMap is a HashMap , where <String, Integer> or key, value. companyName is a String. <s:select label="Pick the company name" headerKey="-1" headerValue="Select Company name" list="companyMap.keys" name

Struts2 preselected checkboxlist

一曲冷凌霜 提交于 2021-02-19 03:48:06
问题 I have tried all the sollutions in similar cases that I found, but with no luck. My jsp. <s:checkboxlist list = "positionsMap" listKey = "%{key.toString()}" listValue = "%{value}" name = "selectedPositions" value = "positionName" label = "Position" /> positionsMap is a Hashmap with key positionId and value positionName . selectedPositions is a list filled with the prechecked positions. Tested with debugger and has the correct value taken from database. positions is a list with id and name. So

JSF ValueChangeListener not working

余生颓废 提交于 2021-02-19 03:32:30
问题 I am learning how to use events with JSF. For some reason, the program is not changing the value in the text field when I change the value of the dropdown menu. The page loads and shows "Germany", but does not change the text field to "DE". Any suggestions? Index.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java

JSF ValueChangeListener not working

爷,独闯天下 提交于 2021-02-19 03:32:04
问题 I am learning how to use events with JSF. For some reason, the program is not changing the value in the text field when I change the value of the dropdown menu. The page loads and shows "Germany", but does not change the text field to "DE". Any suggestions? Index.xhtml: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java

How do I enable on-the-fly compilation of JSPs in Wildfly 9?

心已入冬 提交于 2021-02-19 01:15:24
问题 I’m using Wildfly 9.0.0.CR2. How do I enable on-the-fly compilation of JSPs? I found this configuration in another thread <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false"> <configuration> <jsp-configuration development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/> </configuration> </subsystem> but alas, it doesn’t work, result in gin the below exception when I restart my JBoss server … 14:23:05,224 ERROR

How do I enable on-the-fly compilation of JSPs in Wildfly 9?

只谈情不闲聊 提交于 2021-02-19 01:14:05
问题 I’m using Wildfly 9.0.0.CR2. How do I enable on-the-fly compilation of JSPs? I found this configuration in another thread <subsystem xmlns="urn:jboss:domain:web:1.4" default-virtual-server="default-host" native="false"> <configuration> <jsp-configuration development="true" check-interval="1" modification-test-interval="1" recompile-on-fail="true"/> </configuration> </subsystem> but alas, it doesn’t work, result in gin the below exception when I restart my JBoss server … 14:23:05,224 ERROR