473,594 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use variable in page attribute of jsp include tag?

6 New Member
how to use variable in page attribute of jsp include tag?
Expand|Select|Wrap|Line Numbers
  1. <jsp:include  page="/WEB-INF/fd_jsp/layouts/basketcontent.jsp" />
I want to insert a variable passed as parameter in page attribute .Something like

Expand|Select|Wrap|Line Numbers
  1. <jsp:include  page="/WEB-INF/${templateName}/layouts/basketcontent.jsp" />
Jan 30 '15 #1
1 4515
chaarmann
785 Recognized Expert Contributor
You can use
Expand|Select|Wrap|Line Numbers
  1. <% String s = "templateName"; %>
  2. <jsp:include  page='/WEB-INF/<%=s%>/layouts/basketcontent.jsp' />
Feb 3 '15 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
3386
by: Tom | last post by:
I'm tying myself in knots trying to figure out variable scope with constants and include files. This is what I'm doing: A page (index.php) on my website includes a general purpose include file (ini.inc) that declares a constant DAY_NUM. A little later in the file, ini.inc includes another file (b_data.inc) that tries to use DAY_NUM. I'm getting a "Use of Undefined Constant" notice as a result of this line when I load index.php in the...
2
2791
by: Anthony Judd | last post by:
I am opening a recordset on page 'A' then using server.execute to populate a form on page 'B'. I am getting a a type mismatch error, which suggests the variable doesn't exist on page 'B'. I know variable state is supposed to be maintained when using server.execute.., the problem is what i don't know. 1. could someone please enlighten me as to what is going on. 2. give some suggestion about how work around this problem.
2
31370
by: Richard | last post by:
Suppose I create a variable named "var" such as: <xsl:variable name="var">VarValue</xsl:variable> and then I want to insert its value into an attribute <Element attr=" {the value of var} "> so that it would generate <Element attr=" VarValue "> What syntax do I use to do this? If I specify <Element attr=" <xsl:value-of select='$var'/> "> then the parser complains that &lt; &gt; must be used for
2
2684
by: John Aspinall | last post by:
Hi, Ive got a navigation bar for my web pages in an include (top_nav.asp). On my homepage (index.asp) and all the other site pages I have a reference to this include which includes my navigation bar in each page. <!--#include virtual="/includes/nav/top_nav.asp"-->
6
1829
by: anon | last post by:
Post Forwarding question...... For this control below, <asp:Button runat="server" PostTargetUrl="page2.aspx" /> The Attribute: PostTargetUrl="page2.aspx" Is this PostTargetUrl Attribute going to be available in the <a> and Html Controls as well as opposed to just the <asp:Button> control?
3
4038
by: John Yopp | last post by:
I seem to be have problems with what appears to be variable scoping. If I define a constant in my main HTML page, I do not seem to be able to reference it within functions in JavaScript include files. For instance, I receive the following errors: Error: CONST0 is not defined Source File: test1.js Line: 3
4
2710
by: spectre | last post by:
Hello, I first create a session variable 'client' in the login.asp file The login.asp file opens a file (xxx.asp) with an include file .. If I write <!--#include file="../../../data/" & session("client") & "/language_ger.inc"--> I have a message stating that the application can't find the file.
4
3750
by: benwylie | last post by:
I am running IIS 6.0 on Windows 2003. I would like to be able to run a perl script from a web page and include the output. I have tried doing it with an ssi: <form action='docsearch.shtml' method='get'> <!--#exec cgi="/cgi-bin/docsearch.pl--> </form> This correctly ran the script, but it was unable to include the
2
3298
by: Marc | last post by:
I am studying a bit and I have encountered some reading stuff about skin files, css files and themes in asp.net. To me the name of the StyleSheetTheme page attribute has little a no connection with CSS files, StyleSheets. It's a level of precedence lower then the page attribute 'Theme'. Both attributes refer to the name of a Theme folder that contains skins and css files. But 'StyleSheetTheme' could iqually be named something like...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8255
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.