jsp

Why are my actionErrors and fieldErrors displayed with braces []?

时光总嘲笑我的痴心妄想 提交于 2021-01-28 09:54:32
问题 Once the pages have captured errors within my Struts 2 application the errors are displayed correctly from my resource bundles however they are always displayed with a braces [] For example [first name must not be empty] These are displayed through the tags <s:actionerror /> <s:iterator value="fieldErrors"> <s:property value="value" /> </s:iterator> These come through the Action-validation.xml and setting a addFieldError() through the validation method Is this something to do with my theme

getString from ResultSet with spaces

喜夏-厌秋 提交于 2021-01-28 07:09:34
问题 I'm managing a JDBC database with Servlets/JSPs and one of the attributes I have in a table is a string which may or may not have spaces in between words. I have one JSP to display all the information and another one to edit it, on both I perform getString to a ResultSet and when I'm just displaying it it works fine, but on the edit JSP it only "grabs" the first word before the space and the rest of the string disappears. Here's part of the code: PerfilUsuarioConectado.jsp (the one I use to

how can i prevent a user from directly accessing a pages if not authenticated?

*爱你&永不变心* 提交于 2021-01-28 06:56:23
问题 I am using custom tag and i want to know how can i prevent a user from directly accessing my application pages without authenticating. Below is the view page coding, please let me know how to go about it, I even tried using page session directive but that didnt work. <html> <head> <script> function check(submit) { var x = document.getElementById("r"); var xlength=x.value.length; if(xlength!=5 || x=="") { alert("Enter 5 digit Employee Id"); document.getElementById("r").focus(); return false; }

Cannot redirect a jsp file and display values using Struts 2

别等时光非礼了梦想. 提交于 2021-01-28 06:06:21
问题 I have created a simple program that gets the firstname and lastname of a user using a textfield. But the problem is that when I click the submit button I cannot redirect it to another jsp file which shows the firstname and lastname of the user. Here's my HelloAction class: package com.novamsc.training.struts.action; import com.opensymphony.xwork2.ActionSupport; public class HelloAction extends ActionSupport { private String firstName; private String lastName; public String user(){ return

Cannot redirect a jsp file and display values using Struts 2

荒凉一梦 提交于 2021-01-28 05:55:35
问题 I have created a simple program that gets the firstname and lastname of a user using a textfield. But the problem is that when I click the submit button I cannot redirect it to another jsp file which shows the firstname and lastname of the user. Here's my HelloAction class: package com.novamsc.training.struts.action; import com.opensymphony.xwork2.ActionSupport; public class HelloAction extends ActionSupport { private String firstName; private String lastName; public String user(){ return

is it possible a java web application can call another java web application in same localhost of tomcat server

我的梦境 提交于 2021-01-28 05:00:36
问题 i am trying to deploy two web applications say appA and appB in same local host tomcat server and when the both the applications are up in running is it possible to call appB to appA using ajax call or redirect 回答1: What you are looking for toa chieve can be done using the following tomcat parameter: (from docs) crossContext Set to true if you want calls within this application to ServletContext.getContext() to successfully return a request dispatcher for other web applications running on

Are JSP scriptlets an antipattern? [closed]

人走茶凉 提交于 2021-01-28 02:35:38
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . I hope you understand the question. What do you think? If I post some code here with scriptlet I'm convinced that you're going to tell

How to align div elements?

别说谁变了你拦得住时间么 提交于 2021-01-27 21:50:41
问题 I am trying to make a jsp page on product details. I'm a bit new to CSS so I am unable to align the div elements side by side. .nav { float: right; } * { margin: 0; padding: 0; } body { background-color: #F2EEE9; font: normal 13px/1.5 Georgia, Serif; color: #333; } .item { background-color: #fff; position: relative; margin: 30px auto 30px auto; width: 978px; } .item img { display: block; margin: auto; } <div class="item"> <div style="background: url(http://placehold.it/370x330); height: 370px

Displaytag Export Excel not exporting all rows

ぐ巨炮叔叔 提交于 2021-01-27 15:01:32
问题 I want to export the table data into Excel using Displaytag. Initially it's exporting all the data to Excel, however by default displaytag is using CSV format to export into Excel. This solution fixed that problem Displaytag is exporting CSV into a .xls file However, now new generated excel sheet is having only the selected page data rather than entire table/list. It's exporting 2nd page data is I am in 2nd page and so on. But I want to export all pages data. my complete displaytag.properties

How to include an html fragment in a jsp that loads at run-time?

依然范特西╮ 提交于 2021-01-27 13:40:23
问题 I need to include content in a JSP without using the include directive. It is easy to do a server-side include with with <%@include file="includeMe.htm" %> but the content of includeMe.htm gets added to the JSP before the JSP is converted into a Servlet by the container. This means that if includeMe.htm gets modified, the changes are not reflected in the generated .java Servlet file. I'm tired of going into Tomcats generated files directory to manually delete the generated java and class