Upload.jsp
<form id="upload" name="upload" method="post"
action="UploadServlet"enctype="multipart/form-data">
<br />
<div class="obrazek" id="img-4049424"
style="position: relative; z-index:0;">
<div>
<%=request.getAttribute("mensaje")%> <img src="img/upload/<%=request.getAttribute("logotipo")%>"
alt="" style="float: left;width: 120px; height: 120px;">
</div>
<span class="upload-wrapper">
<img src="img/up_16.gif" alt="" style="margin-top: 50px;">
<a href="javascript:doClick()" id="fileSelect" style="font-weight: bold;" >Cargar logotipo...</a>
</span>
</div>
<div id="uploadfile" style="position: absolute; background-color:transparent;
width: 210px; height: 215px;
overflow: hidden;
z-index: -1; opacity: 0;
top: 5px; left: 5px;
background-position: initial initial; background-repeat: initial initial;" >
<input id="file" name="file" type="file" accept="image/jpeg,image/png"
style="font-size: 15px; position: absolute; width: 100%;
height: 100%;" onchange="handleFiles(this.files)">
</div>
<input type="submit" value="Subir logotipo" />
</form>
UploadServlet.java
mensaje="successfully";
request.setAttribute("logotipo", fileName);
request.setAttribute("mensaje", mensaje);
request.getRequestDispatcher("vistas/Upload.jsp")
.forward(request, response);
What I need is reload to Upload.jsp to display the uploaded image, because now I no image appears on the jsp and the file is loaded successfully...
Related
I have written some HTML-CSS in a file, It works perfectly in the browser but when I change the extendion to vm ( for apache velocity) . some of the css doesn't work . why is velocity not able to understand the css.
CODE:
<html>
<head>
<title>Letter</title>
<style>
.row {
width: 100%;
display:flex;
height:80px;
}
.column1 {
width:33%;
float: left;
}
.column2 {
width:33%;
float: center;
}
.column3 {
width:33%;
float: right;
}
body {
padding: 20px;
font-size: 12px;
font-family: Arial,Arial Unicode MS,Quivira,sans-serif,Wingdings;
}
#rcorners2 {
border-radius: 25px;
align-items:center;
border: 1px solid grey;
padding: 20px;
width: 1000px;
height: 50px;
display:flex;
}
.vl {
border-left: 1px solid grey;
height: 50px;
}
.gap{width:200px;background:none;height:200px;display:inline-block;}
</style>
</head>
<body>
<div class="row">
<div class="column1">
<img src="https://www.iconfinder.com/data/icons/pictype-free-vector-icons/16/home-512.png" height="50px" width="250" />
</div>
<div class="column2">
<h1 style="text-align: center;"> Letter Head</h1>
</div>
<div class="column3">
<h2 style="color:#AE275F;text-align: right;">SAMPLE</h2>
</div>
</div>
<div>
<div id="rcorners2" > </div>
<div>
<p>Date </p>
<p>MAY 28,2020</p>
</div>
<div class="gap">
</div>
<div class="vl"></div>
</div>
</body>
</html>
The problem was not with my velocity template. I was using Itext5 to convert HTML to PDF and as Itext5 does not support HTML5 , some of the features weren't working.
I am using openHtmlToPdf library for converting HTML to PDF and the css works perfectly now.
I'm trying to scroll this pdf: ifcharts.ml/KSAN.html
I've got this so far:
<section class="features section-padding" id="features">
<div class="container">
<div class="row">
<div class="feature-list">
<h3>San Diego</h3>
<p>Departure</p>
<div>
<iframe class="js/scroll-wrapper.js" src="http://flightaware.com/resources/airport/SAN/APD/AIRPORT+DIAGRAM/pdf" width="600" height="700"></iframe>
<iframe class="js/scroll-wrapper.js" src="https://flightaware.com/resources/airport/KSAN/DP/all/pdf" width="600" height="700"></iframe>
</div>
<p>Approach</p>
<div>
<iframe class="js/scroll-wrapper.js" src="https://flightaware.com/resources/airport/KSAN/STAR/all/pdf" width="600" height="700"></iframe>
<iframe class="js/scroll-wrapper.js" src="https://flightaware.com/resources/airport/KSAN/IAP/all/pdf" width="600" height="700"></iframe>
</div>
</div>
</div>
</div>
</section>
The class="js/scroll-wrapper.js" leads to this:
.scroll-wrapper {
position: fixed;
right: 0;
bottom: 0;
left: 0;
top: 0;
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
}
.scroll-wrapper iframe {
height: 100%;
width: 100%;
}
That is what the the script is meant to run, however it still is not scrolling on iOS.
I also have a problem where it is downloading the code on Android. How can I set it now to download?
Thanks
I am writing Script to open a Record from Dash Board of MSCRM 2011. Those Records are arranged in table as Checkbox inside a Frame. So on double click of Checkbox Record Page will open
Below is Exception which i am getting
java.util.NoSuchElementException
at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown Source)
at java.util.LinkedHashMap$KeyIterator.next(Unknown Source)
at Ford_Account.main(Ford_Account.java:112)
Below is Webdriver Code
WebElement link = w1.findElement(By.xpath("html/body/div[5]/div[1]/div[2]/span/ul/li[2]/ul/li[1]/a[1]")); //COntact click
link.click();
w1.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
try {
windows= w1.getWindowHandles();
iterator=windows.iterator();
while((iterator.hasNext())){
parent=iterator.next();
child=iterator.next();
w1.switchTo().window(child);
System.out.println("Swicthed to child");
Thread.sleep(1000);
}
w1.switchTo().frame("contentIFrame");
Actions ac = new Actions(w1);
WebElement element = (WebElement) ac.moveToElement(w1.findElement(By.id("checkBox_{EE9744AC-6737-E511-8459-E4115BDF9DFD}")));
ac.doubleClick(element).perform();
I am Getting Exception on
child=iterator.next();
Below is HTML Structure
<iframe id="contentIFrame" frameborder="0" name="contentIFrame" style="border: 0px none; overflow: hidden; position: absolute; left: 0px; right: 0px; height: 100%; width: 100%; opacity: 1; display: inline;" title="Content Area" src="/_root/homepage.aspx?etc=1&pagemode=iframe&sitemappath=CS%7cCS%7cnav_accts&whr=https%3a%2f%2fmscrm00b.hpuscrmpoc.com%2fadfs%2fservices%2ftrust">
<!DOCTYPE html>
<html webdriver="true">
<head>
<body class="stage">
<div class="stdTable">
<span id="__Page_crmEventManager" style="display:block;height:0px;"></span>
<div></div>
<div>
<div style="height:0px;">
<div id="homepageTableCell" class="ms-crm-absolutePosition" style="top:27px;">
<div class="ms-crm-IE7-Height-Fix-Dummy-Container">
<div id="crmGrid_visualizationCompositeControl" style="height:100%;">
<div id="crmGrid_compositeControl" style="height:100%;width:100%;position:relative;">
<div id="crmGrid_crmGridStrip" class="ms-crm-CC-GridSS-All-0-LR">
<div id="crmGrid_crmGridTD" class="ms-crm-CC-grid-All-0-LR">
<div class="ms-crm-IE7-Height-Fix-Dummy-Container">
<div id="crmGrid_filterSet" gridid="crmGrid"></div>
<div class="ms-crm-grid-BodyContainer" style="width:100%;height:100%;position:relative;overflow:hidden;">
<div id="crmGrid" class="ms-crm-ListControl" type="crmGrid">
<div class="ms-crm-grid-body" style="bottom:25px;">
<div class="ms-crm-IE7-Height-Fix-Dummy-Container">
<div id="crmGrid_gridBodyContainer" class="ms-crm-grid-BodyContainer" style="height:100%;position:relative">
<div id="refreshButton" class="ms-crm-List-RefreshButton" style="left: auto; right: 0px; display: inline;">
<div class="ms-crm-ListArea" style="position:relative">
<div class="ms-crm-grid-BodyContainer" style="height:22px;OVERFLOW-X:hidden;">
<div class="ms-crm-grid-databodycontainer" style="top:22px;bottom:22px;vertical-align:top">
<div class="ms-crm-IE7-Height-Fix-Dummy-Container">
<div id="crmGrid_divDataBody" class="ms-crm-List-DataBody">
<div id="crmGrid_divDataArea" class="ms-crm-List-DataArea" expandable="0">
<div>
<table id="gridBodyTable" class="ms-crm-List-Data" cellspacing="0" cellpadding="1" border="1" style="border-style:None;border-collapse:collapse;" summary="This list contains 7 Account records." primaryfieldname="name" tabindex="0" numrecords="7" oname="1" allrecordscounted="1" totalrecordcount="7" morerecords="0" rules="rows">
<colgroup>
<thead>
<tbody>
<tr class="ms-crm-List-Row" otypename="account" otype="1" oid="{21C2F87E-9E36-E511-8459-E4115BDF9DFD}">
<td class="ms-crm-List-NonDataCell" align="center">
<input id="checkBox_{21C2F87E-9E36-E511-8459-E4115BDF9DFD}" class="ms-crm-RowCheckBox" type="checkbox" style=" " title="ford Account123" tabindex="0">
</td>
Can anyone Suggest me how to open a record from dashboard of MSCRM 2011
I searched high and low and still can't figure this out. I am creating a web to lead form and I have a drop down field called Referral, with choices of Internet, Friend, etc.
If they select Friend, I would like a table row to appear underneath called Friend Name, where they can enter their friend's name. If something else is selected this would be hidden.
Please see the code below. Thank you!
<span style="font-family: arial, helvetica, sans-serif;">Referral: <span class="required" style="color: #ff0000;">*</span></span></td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span style="font-family: arial, helvetica, sans-serif;">
<select id="referral_c" name="referral_c" tabindex="1" onchange="show_referral();">
<option selected="selected" value="Internet">Internet</option>
<option value="Friend" id="friend_click">Friend</option>
<tr>
<td style="text-align: left; font-size: 12px; font-weight: normal;" width="15%">
<span style="font-family: arial, helvetica, sans-serif;">Friend Name: <span class="friend" style="color: #ff0000;"></span></span></td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span class="friend" style="font-family: arial, helvetica, sans-serif;">
<input id="friend_name_c" type="text" name="friend_name_c" /></span></td>
</tr>
function show_referral(){
var referral = document.getElementById("referral_c");
var referral_text = referral.options[referral.selectedIndex].text;
$("#friend_click").click(function () {
$(".friend").show();
});
}
First, I would be remiss if I didn't recommend putting the styles in a separate css file. Be that as it may, one possible solution is:
<table>
<tr>
<td>
<span style="font-family: arial, helvetica, sans-serif;">Referral: <span class="required" style="color: #ff0000;">*</span></span>
</td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span style="font-family: arial, helvetica, sans-serif;">
<select id="referral_c" name="referral_c" tabindex="1" onchange="show_referral();" >
<option selected="selected" value="Internet">Internet</option>
<option value="Friend" id="friend_click">Friend</option>
</select>
</span>
</td>
</tr>
<tr id="friend_row" style="display: none;">
<td style="text-align: left; font-size: 12px; font-weight: normal;" width="15%">
<span class="friend" style="font-family: arial, helvetica, sans-serif;">Friend Name: <span class="friend" style="color: #ff0000;"></span></span>
</td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span class="friend" style="font-family: arial, helvetica, sans-serif;">
<input id="friend_name_c" type="text" name="friend_name_c" /></span>
</td>
</tr>
</table>
function show_referral() {
var referral = document.getElementById("referral_c");
var referral_text = referral.options[referral.selectedIndex].text;
if (referral_text === "Friend") {
$("#friend_row").show();
} else {
$("#friend_row").hide();
}
}
UPDATE: complete working page
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<table>
<tr>
<td>
<span style="font-family: arial, helvetica, sans-serif;">Referral: <span class="required" style="color: #ff0000;">*</span></span>
</td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span style="font-family: arial, helvetica, sans-serif;">
<select id="referral_c" name="referral_c" tabindex="1" onchange="show_referral();" >
<option selected="selected" value="Internet">Internet</option>
<option value="Friend" id="friend_click">Friend</option>
</select>
</span>
</td>
</tr>
<tr id="friend_row" style="display: none;">
<td style="text-align: left; font-size: 12px; font-weight: normal;" width="15%">
<span class="friend" style="font-family: arial, helvetica, sans-serif;">Friend Name: <span class="friend" style="color: #ff0000;"></span></span>
</td>
<td style="font-size: 12px; font-weight: normal;" width="35%">
<span class="friend" style="font-family: arial, helvetica, sans-serif;">
<input id="friend_name_c" type="text" name="friend_name_c" /></span>
</td>
</tr>
</table>
<script type="text/javascript">
function show_referral() {
var referral = document.getElementById( "referral_c" );
var referral_text = referral.options[referral.selectedIndex].text;
if (referral_text === "Friend") {
$( "#friend_row" ).show();
} else {
$( "#friend_row" ).hide();
}
}
</script>
</body>
</html>
I'm trying to access static content on a login page jsp and I'm failing to do so.
The security config method I'm using is:
#Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/admin/**","/images/**")
.access("hasRole('ADMIN')").and().formLogin()
.loginPage("/user/login").failureUrl("/login?error")
.usernameParameter("username")
.passwordParameter("password")
.and().logout().logoutSuccessUrl("/login?logout")
.and().csrf()
.and().exceptionHandling().accessDeniedPage("/403");
}
The login page that fails to load images and static resources is:
<%#include file="../include/include.jsp"%>
<%#include file="../decorators/tbs_imports.jsp"%>
<html>
<head>
<title><s:message code="title"></s:message></title>
<style>
html,body {
background-color: #eee;
}
body {
padding-top: 5px;
}
.content {
width: 300px;
}
/* The white background content wrapper */
.container>.content {
background-color: rgba(113, 121, 225, .15);
padding: 15px;
margin: 0 -20px;
-webkit-border-radius: 10px 10px 10px 10px;
-moz-border-radius: 10px 10px 10px 10px;
border-radius: 10px 10px 10px 10px;
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
-moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.login-form {
margin-left: 70px;
}
</style>
<script type="text/javascript">
window.onload = function() {
document.login.j_username.focus();
}
function changeFlag() {
var lang = $("#langDrop option:selected").text();
if (lang == 'Portugues') {
$('#flag').attr('src', '../images/br.png');
}
if (lang == 'English') {
$('#flag').attr('src', '../images/en.png');
}
if (lang == 'Espanol') {
$('#flag').attr('src', '../images/es.png');
}
}
</script>
</head>
<body>
<div style="display: block; margin-left: auto; margin-right: auto"
class="container">
<div style="padding-bottom: 5px">
<img
style="padding-top: 10px; display: block; margin-left: auto; margin-right: auto"
src="${pageContext.request.contextPath}/images/logo_pims_scf_grande.png" />
</div>
<c:if test="${not empty duplicated_user}">
<div
style="display: block; margin-left: auto; margin-right: auto; text-align: center"
class="content alert alert-error">
<strong><s:message code="login-duplicate-user" /></strong>
</div>
</c:if>
<br /> <br />
<c:if test="${not empty session}">
<div
style="display: block; margin-left: auto; margin-right: auto; text-align: center"
class="content alert alert-error">
<strong><s:message code="session-maxLimitReached" /></strong>
</div>
</c:if>
<c:if test="${not empty corrupted}">
<div
style="display: block; margin-left: auto; margin-right: auto; text-align: center"
class="content alert alert-error">
<strong><s:message
code="session-value-corrupted-in-the-database" /></strong>
</div>
</c:if>
<c:if test="${empty session}">
<c:if test="${empty corrupted}">
<div style="display: block; margin-left: auto; margin-right: auto"
class="content">
<div class="row">
<div class="login-form">
<h4 style="padding-bottom: 10px">Login</h4>
<form id="j_acegi_security_check" onsubmit="return true;"
name="login"
action="${pageContext.request.contextPath}/j_acegi_security_check"
method="POST">
<fieldset>
<div class="clearfix">
<input style="height: 25px;" id="username" name="j_username"
type="text" placeholder="Username">
</div>
<div class="clearfix">
<input style="height: 25px;" name="j_password" id="password"
type="password" placeholder="Password">
</div>
<br>
<button class="btn btn-primary" type="submit">
<s:message code="join" />
</button>
</fieldset>
</form>
</div>
</div>
</div>
</c:if>
</c:if>
</div>
</body>
</html>
The WebContent folder structure is:
WebContent
- css
- images
- js
- META-INF
- WEB-INF
- classes
- jsp
- lib
- tags
- index.jsp
- web.xml
Since this application is annotations driven, the web.xml file is blank. And index.jsp redirects to /jsp/user/login.jsp.
Any ideas how to solve this issue?
Thanks in advance.