answerstu

Tomcat 8 JSP application not load external jar files copied in WEB-INF/LIB Folder

I am developing jsp webapp and running it through ROOT/myprojectFolder of the Tomcat 8. All pages are working fine. But in one .jsp page, i want to import and external .jar file, say json-simple.1.1.1.jar. As per this linkunder the Bold Heading of WebappX:, .... resources in JAR files under the /WEB-INF/lib directory of your web application, are made visible to this web application.... So I have put json-simple.1.1.1.jar in ROOT/myprojectFolder/WEB-INF/lib folder. But when I run the .jsp page on browser, I get the error of JsonArray cannot be r...Read more

jsp - Populate drop down menu from database

I have this method in my controller to get all the created floors so that I can use it in creating a room record.@RequestMapping(method = RequestMethod.POST, produces = "text/html") public String create(@Valid Room room, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { if (bindingResult.hasErrors()) { populateEditForm(uiModel, room); return "rooms/create"; } uiModel.asMap().clear(); roomService.saveRoom(room); return "redirect:/rooms/" + encodeUrlPat...Read more

jsp - How to create wizards in grante UI and design it in coral UI html in AEM

As i am new to AEM development, I want to know how to create wizards in AEM and how to design those using coral UI. As i have created wizard and it contains two step view: source ---> selectI have designed this two step wizard and i have to show different items on each step.This steps are nothing but nodes under my createfragment page. 1) Source: I am having two radio buttons lets suppose selecting gender like male and female. I have created node for source and under source items, created two radio buttons. Functionality: Th...Read more

jsp - html minification in AEM 6.0

I am trying to use HTML minification using the html compressor tag library in Maven https://mvnrepository.com/artifact/com.googlecode.htmlcompressor/htmlcompressor/1.4i added the below dependencies to pom.xml<dependency> <groupId>com.googlecode.htmlcompressor</groupId> <artifactId>htmlcompressor</artifactId> <version>1.4</version></dependency><dependency> <groupId>com.yahoo.platform.yui</groupId> <artifactId>yuicompressor</artifactId> <version>...Read more

AEM unable to access jsp from url

I created a JSP file directly via CRX into my website. The target is to access it via a direct url instead of a separate template. Example: http://localhost:4502/content/mywebsite/somepage/test.jspBut the browser just gives me option to download it instead of opening and processing the jsp and the code inside it.I cannot use an HTML file as I need to run some Java code in this JSP....Read more

jsp - Getting error :"org.apache.sling.api.scripting.ScriptEvaluationException: when running AEM 6 author

When running AEM 6 author in local:4502 getting below error :<!--cq{"decorated":false,"type":"corporate/business-center/components/page/dashboard","path":"/content/dev/corporate/mybiz/en_us/dashboard/jcr:content","selectors":null,"servlet":"Script /apps/corporate/business-center/components/page/global/global.jsp","totalTime":1,"selfTime":1,"exception":"org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: /apps/corporate/business-center/components/page/global/global.jsp(2,0) /apps/co...Read more

Auto Refresh a DIv in a JSP which includes the output of a Servlet

I have a servlet "Servlet1" which sends a table data including the and other tags in a format to show in HTMLand I have included the servlet output into a jsp page as follows:<div id="loadTable"><jsp:include page="/Servlet1" /></div>No I want this div to auto refresh every 5 sec. Can anyone help me with that?I tried the following but it didn't refresh at all (though I am getting initial output of the servlet into my jsp page.<script type="text/javascript">setInterval(function (){$.get('/Servlet1', function(data) { ...Read more

jsp - Delete name from database

I have a jsp web page. I need to delete the username from database when i press the delete button from the web page. I tried the codes below but I cant delete the name, instead it insert a new row and an empty value in the username database. Here's my codesUnblockServlet.java : protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stubString username = request.getParameter("username");System.out.println("username="+username);CustomerInfor unblockUs...Read more

jsp - WebLogic12C - The code of method _jspService(HttpServletRequest, HttpServletResponse) is exceeding the 65535 bytes limit

I'm dealing with a legacy servlet code that runs on WebLogic 10.3.6 (JDK 1.6).I am trying to compile this code with JDK 1.8 and weblogic 12.2.1.0. When i am trying to compile the jsp page with jdk 1.8, i am seeing the following error. I tried the below options to fix this problem 1) i tried Dynamic includes for JSP 2) I tried adding <servlet><servlet-name>jsp</servlet-name><servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>...<init-param> <param-name>mappedfile</param-name> ...Read more

jsp - Evaluate empty or null JSTL c tags

How can I validate if a String is null or empty using the c tags of JSTL?I have a variable of name var1 and I can display it, but I want to add a comparator to validate it.<c:out value="${var1}" />I want to validate when it is null or empty (my values are strings)....Read more

jsp - Encoding issue in html:form with Struts 1.2

I have an application with Struts 1.2 and in a .jsp I've created a form using html tag, this is part of my code:<%@ page contentType="text/html;charset=UTF-8" language="java" %><%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%><%@ taglib uri="http://struts.apache.org/tags-html-el" prefix="html" %>...<html:form action="/myAction" method="post">... <display:table name="ListOfEntries" sort="external" requestURI="/myEntryAction.do" uid="row"> ... <display:column titleKey="label.label" sortable...Read more

handlebars.js - Access a JSON value while iterating over array in HandleBar jsp

I have a json with the below values(Sample).[ { "sectionTitle":"LATEST NEWS", "language":"ENGLISH", "sectionLink":"/content/ml/sample.html", "newTab":"", "ViewType":"slrr", "bgColor":"red", "fontColor":"white", "logo":"", "articleNewTab":"true", "Results":[ { "title":"sample title", "description":"sample desc"}, { "title":"sample title1", "description":"sample desc1"} ], "morelinkJson":{ "moreLink":"/content/mm/ml/news/just-in.htm...Read more