Having problems creating such a layout. Controllers trigger dash content, and the layout should be created. Now I have this definitions, and I am blocked.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="masterLayout" template="/WEB-INF/jsp/layout/master.jsp">
<put-attribute name="headerInclude" value="" />
<put-attribute name="body" value="" />
<put-attribute name="footerInclude" value="" />
</definition>
<definition name="dashboardLayout" extends="masterLayout">
<put-attribute name="body" value="dashboardLayoutBody" />
</definition>
<definition name="dashboardLayoutBody" template="/WEB-INF/jsp/layout/dashboard.jsp">
<put-attribute name="menu" value="/WEB-INF/jsp/parts/menu.jsp" />
<put-attribute name="body"/>
</definition>
<!-- this page is triggered -->
<definition name="login_page" extends="masterLayout">
<put-attribute name="body" value="/WEB-INF/jsp/layout/login.jsp" />
</definition>
<!-- this page is triggered -->
<definition name="some_page" extends="dashboardLayout">
<put-attribute name="body" value="/WEB-INF/jsp/content/admin_groups/supervisor.jsp"/>
</definition>
</tiles-definitions>
master layout has this content
<!DOCTYPE html>
<html>
<head>
<!-- Master css, js, meta, tags additions .... -->
<tiles:insertAttribute name="headerInclude"/>
</head>
<body>
<tiles:insertAttribute name="body"/>
<!-- Master css, js, meta, tags additions .... -->
<tiles:insertAttribute name="footerInclude"/>
</body>
</html>
I need somehow to extend template and also have own template, to include menu there
As a new comer to jsp templating, I didn't realized that I can use jsp:include in parallel with Aapache Tiles, which solved the problem.
The main problem was that I couldn't include the menu once only in the dashboard layout, and be used everywhere.
Using only tiles, there is cascade attribute on a put-attribute tag that allow that to be used in other attributes also.
Keep in mind that cascade needs DOCTYPE tiles-definition minimum version 2.1
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
Related
I want to use deep link to create a Online-Shop App. So Hear me out.
I know I have to use Intent and add <Intent-Filter><Intent-Filter/> tag in my AndroidManifest.xml file but I can't begin to understand how all of it works. There are few packages in pub.dev like flutter_branch_sdk: ^3.4.0 or receive_sharing_intent: ^1.4.5 but I'm hoping for a complete explanation or some sort of guide here. I appreciate the time you spend reading this in advance.
Here we go:
I have a app that has a Payment page. when user clicks on the Pay Now Button, He is transferred to a Safe Payment Gateway and interacts with the page. so there are 2 possible scenarios
He Succeeds in Completing the task and pays for the CARGO.
At this point Browser must Return to my app and gives me a text/message such as success and the app displays the Payment_Successful_Page
He Fails in Completing the task and pays for the CARGO
At this point Browser must Return to my app and gives me a text/message such as failure and the app displays the Payment_Failed_Page
That said If you know how it works maybe you can answer the questions below. (I have gathered the code parts from few documents and guides)
What is the <actvity><actvity/> do and what does the code below configure?
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
android:launchMode="singleTask"
<intent-filter>
...etc categories
</intent-filter>
</activity>
what does the <action/> do? How should I use it in app?
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.INPUT_METHOD_CHANGED" />
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
<intent-filter />
how can I work with <category/> and What does the code below says?
what is the tag I should use for my scenario here?
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
how can I work with <data/> and What does the code below says?
How to get that text/message I want from the browser?
How to configure my own website where "example.com" is?
What are scheme and host here and how should it be written? (with 'http://' or without)
<data android:scheme="myapp" android:host="example.com" />
<data android:scheme="https" />
<data android:mimeType="text/plain" />
<data android:mimeType="text/*" />
<data android:mimeType="video/*" />
<data android:mimeType="image/*" />
<data android:mimeType="*/*" />
<data android:scheme="http" android:host="flutterbooksample.com" />
<data android:scheme="https" />
I'm having a primefaces rendering issue in one Eclipse App but not in another. I've compared web.xml's and pom's and tried to make them identical, at least as far as dependencies which might affect the rendering of primefaces. I've cleaned the offending project, updated the project under Maven, checked project facets, etc, but I still can't get the one app to render primefaces components the way they look in another app or in the showcase.
I reduced a page down to its simplest case using two primefaces buttons and identical templates with no additional CSS files. Here's how each app renders the buttons:
bad rendering, show with pointer hovering over top button
good rendering, which proper hover highlight and rounded corners
the button spacings are also different. In the bad rendering there also appears to be some extra border outlining the whole canvas (white content area)
Facelet:
<h:body>
<ui:composition template="/WEB-INF/templates/hmmcommonLayout.xhtml">
<ui:define name="title">title</ui:define>
<ui:define name="content">
<h:form>
<p:button outcome="hr" value="With Icon" icon="ui-icon-star">
<f:param name="productId" value="24" />
</p:button>
</h:form>
<h:form>
<p:button outcome="hr" icon="ui-icon-star" title="Icon Only">
</p:button>
</h:form>
<br></br>
</ui:define>
</ui:composition>
</h:body>
</html>
Template:
<?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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui" xmlns:o="http://omnifaces.org/ui"
xmlns:of="http://omnifaces.org/functions">
<h:head>
<title><ui:insert name="title">template title</ui:insert></title>
</h:head>
<h:body>
<div class="logoText">template logo text</div>
<ui:insert name="content"></ui:insert>
</h:body>
</html>
The generated html is basically identical. What else can I check??
It turned out to be a conflict between richfaces and primefaces. Both Eclipse projects POM's contained primefaces and richfaces dependencies. The project rendering things properly had the following in its web.xml. Once I added these statements to my second project's web.xml things rendered properly there as well.
<context-param>
<param-name>org.richfaces.skin</param-name>
<param-value>plain</param-value>
</context-param>
<context-param>
<param-name>org.richfaces.enableControlSkinning</param-name>
<param-value>false</param-value>
</context-param>
Is there any way to reset the font size without accessing the UI/program? I accidentally changed the font size a little too big and now all the UI is messed up and I can't see anything (not even a button) in phpstorm.
<?xml version="1.0" encoding="UTF-8"?>
<application>
<component name="UISettings">
<option name="FONT_SIZE" value="16" />
<option name="OVERRIDE_NONIDEA_LAF_FONTS" value="true" />
<option name="SHOW_DIRECTORY_FOR_NON_UNIQUE_FILENAMES" value="true" />
</component>
</application>
Nevermind found it! Its located in C:>users\username.WebIde70\config\options
Under ui.lnf.xml.
I've got a pretty basic Spring MVC application that I created using Spring Roo. So the whole project is set up as a standard Spring/Tiles application (scaffolding created by Roo as well). When I look at the generated HTML source code, I see that all the whitespaces/linebreaks have been trimmed. For debugging purposes, this is difficult/problematic for me.
I'm using Spring 3.x with Tomcat 7.
I've searched around SO and the web and found that there is a trimWhiteSpace jsp directive (example at this SO post), but when I search the entire Roo generated codebase, I do not see this directive anywhere.
I've even gone so far as adding the <init-param> and the <jsp-config> lines to the web.xml specifying false, but that has made no difference either.
At this point, I am not sure if it is Tomcat that is stripping the spacing or if it is something in Spring/Tiles that is doing the deed.
How can I disable this feature and have all the spacing/linebreaks outputted in my HTML that exist in my tag definitions and my jsp files?
Example of generated HTML:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML SYSTEM "about:legacy-compat">
<html><head><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><meta content="IE=8" http-equiv="X-UA-Compatible"/><link href="/V2/resources/dijit/themes/tundra/tundra.css" type="text/css" rel="stylesheet"/><link href="/V2/resources/styles/standard.css" media="screen" type="text/css" rel="stylesheet"/><link href="/V2/resources/images/favicon.ico" rel="SHORTCUT ICON"/><script type="text/javascript">var djConfig = {parseOnLoad: false, isDebug: false, locale: 'en-us'};</script><script type="text/javascript" src="/V2/resources/dojo/dojo.js"></script><script type="text/javascript" src="/V2/resources/spring/Spring.js"></script><script type="text/javascript" src="/V2/resources/spring/Spring-Dojo.js"></script><script type="text/javascript" language="JavaScript">dojo.require("dojo.parser");</script><script type="text/javascript" src="/V2/resources/jQuery/jquery-2.0.3.min.js"></script><link href="/V2/resources/jQWidgets-3.0.2/styles/jqx.darkblue.css" type="text/css" rel="stylesheet"/><script type="text/javascript" src="/V2/resources/jQWidgets-3.0.2/jqxcore.js"></script><title>Welcome to V2</title></head><body class="tundra spring"><div id="wrapper"><div version="2.0" id="header"><a title="Home" name="Home" href="/V2/"><img src="/V2/resources/images/banner-graphic.png"/></a></div><div id="main"><div version="2.0"><script type="text/javascript">dojo.require('dijit.TitlePane');</script><div id="_title_title_id"><script type="text/javascript">Spring.addDecoration(new Spring.ElementDecoration({elementId : '_title_title_id', widgetType : 'dijit.TitlePane', widgetAttrs : {title: 'Internal Error', open: true}})); </script><h2>Internal Error</h2><p>Sorry, we encountered an internal error.</p></div></div><div version="2.0" id="footer"><span>Home</span><span id="language"> | Language: <a title="Switch language to English" href="?lang=en"><img alt="Switch language to English" src="/V2/resources/images/en.png" class="flag"/></a> </span><span> | Theme: <a title="standard" href="?theme=standard">standard</a> | <a title="alt" href="?theme=alt">alt</a></span><span><a title="Sponsored by SpringSource" href="http://springsource.com"><img src="/V2/resources/images/springsource-logo.png" alt="Sponsored by SpringSource" align="right"/></a></span></div></div></div></body></html>
Example of default.jspx (base tiles layout):
<html xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:tiles="http://tiles.apache.org/tags-tiles" xmlns:spring="http://www.springframework.org/tags" xmlns:util="urn:jsptagdir:/WEB-INF/tags/util" >
<jsp:output doctype-root-element="HTML" doctype-system="about:legacy-compat" />
<jsp:directive.page contentType="text/html;charset=UTF-8" />
<jsp:directive.page pageEncoding="UTF-8" />
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<util:load-scripts />
<spring:message code="application_name" var="app_name" htmlEscape="false"/>
<title><spring:message code="welcome_h3" arguments="${app_name}" /></title>
</head>
<body class="tundra spring">
<div id="wrapper">
<tiles:insertAttribute name="header" ignore="true" />
<tiles:insertAttribute name="menu" ignore="true" />
<div id="main">
<tiles:insertAttribute name="body"/>
<tiles:insertAttribute name="footer" ignore="true"/>
</div>
</div>
</body>
</html>
As you can see, all the whitespaces/linebreaks from the tiles layout definitions have been stripped out.
So, after a lot of painful hair pulling (and a few links that pushed me in the right direction), it turns out that the whitespace trimming isn't from the container, but rather from the JSPX parser. Given that they are XML files, the parser is loading up the entire DOM structure and then dumping it out. In building the DOM, it obviously loses and spacing information between the tags. Apparnetly (I haven't tested) the only way to retain spacing between the tags is to enclose everything in <jsp:text> blocks (see here).
On the other hand, I just gave up and converted everything to JSP files and everything works fine. Easier for me to deal with at the moment.
i am working on a struts2 web app where i am using Apache tiles2 framework.
The Code is Working Fine on localhost but when i up the code on server it renders the tiled pages as plain text. can anyone please tell me where is the problem.
i mean to say that the page is displayed as plaintext on browser-side.
this is how it is rendered in browser.. Screenshot - http://i42.tinypic.com/2vnj686.jpg
kindly help me if anyone have a solution....
here is my tiles.xml
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd" >
<!-- "http://tiles.apache.org/dtds/tiles-config_2_1.dtd" -->
<tiles-definitions>
<definition name="BaseDef" template="/adminpanel/template/BaseLayout.jsp">
<put-attribute name="title" value="Home Page" />
<put-attribute name="css" value="/adminpanel/template/extracss.jsp" />
<put-attribute name="js" value="/adminpanel/template/js.jsp" />
<put-attribute name="header" value="/adminpanel/template/header.jsp" />
<put-attribute name="body" value="/adminpanel/template/body.jsp" />
<put-attribute name="footer" value="/adminpanel/template/footer.jsp" />
</definition>
<definition name="LatestMaterial" extends="BaseDef">
<put-attribute name="title" value="Latest Exam Material " />
<put-attribute name="css" value="/adminpanel/template/newtablecss2.jsp" />
<put-attribute name="body" value="/adminpanel/Pages/latestexammaterial.jsp" />
</definition>
</tiles-definitions>
here is my BaseLayout.jsp
<%# page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%# taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<tiles:insertAttribute name="css"/>
<tiles:insertAttribute name="js"/>
<title><tiles:insertAttribute name="title" /></title>
</head>
<body>
<div id="main">
<tiles:insertAttribute name="header"/>
<div id="body">
<tiles:insertAttribute name="body"/>
</div></div>
<tiles:insertAttribute name="footer"/>
</body>
</html>
this is how i used it in struts.xml
<package name="wz.admin" extends="struts-default,json-default,tiles-default">
<action name="LatestMaterial" class="org.wz.admin.LatestMaterialAction">
<result type="tiles">LatestMaterial</result>
</action>
</package>
I checked with a fresh mind your code and I think the problem is your struts.xml since everything seems fine. I'm not sure at 100% but try to change your struts.xml into this:
<package name="wz.admin" extends="struts-default" namespace="/">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult" />
</result-types>
<action name="LatestMaterial" class="org.wz.admin.LatestMaterialAction">
<result type="tiles">LatestMaterial</result>
</action>
</package>
Also, even if the success result is the default one, you should name your results in order to avoid misurdenstand when managing multiple results:
<result name="success" type="tiles">LatestMaterial</result>
This was just a suggestion that my architect gave me when i was working with struts. In the end I found it really usefull.