Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8443323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T09:06:22+00:00 2026-06-10T09:06:22+00:00

I am creating web application where I have below code. <p:commandButton ajax=false style=#{patentInfo.photoType.contains(‘application’)? ‘visibility:visible;width:200px;height:200px;

  • 0

I am creating web application where I have below code.

<p:commandButton ajax="false" 
 style="#{patentInfo.photoType.contains('application')?
 'visibility:visible;width:200px;height:200px;
  background-image: url(DisplayImage?mainID=tempo1&amp;id=#{patentInfo.photoType});
  background-repeat: no-repeat;background-size: 100% 100%;'
 :
 'visibility:hidden;width:2px;height:2px;'}">

I am setting background image where I am using Java class as DisplayImage and passing parameter to those as mainID=tempo1&amp;id=#{patentInfo.photoType}. In java, I am printing mainID & id for testing purpose.

DipalyImage.java

String mainID = request.getParameter("mainID");
String id = request.getParameter("id");
System.out.println("mainID=="+mainID+", id=="+id);

patentInfo.photoType will hold data as application/pdf

The problem is at background image parameters that I am passing.

  1. When I use background-image: url(DisplayImage?mainID=tempo1&amp;id=#{patentInfo.photoType}); & print mainID & id I get values as below.

    mainID=temp1 & id=

    I don’t get anything for id…..

  2. When I use background-image: url(DisplayImage?mainID=tempo1&amp;id=patentInfo.photoType); & print mainID & id I get values as below.

    mainID=temp1 & id=patentInfo.photoType

What I am doing wrong here?

I am expecting output as mainID=temp1 & id=application/pdf

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T09:06:23+00:00Added an answer on June 10, 2026 at 9:06 am

    The problem is that you have #{ ... #{} ...} in your el.

    Try something like this:

    <p:commandButton ajax="false" style="#{patentInfo.photoType.contains('application')?'visibility:visible;width:200px;height:200px;background-image: url(DisplayImage?mainID=tempo1&amp;id='.concat(patentInfo.photoType).concat(';background-repeat: no-repeat;background-size: 100% 100%;'):'visibility:hidden;width:2px;height:2px;'}">

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating web application using jsf 2.0. I have command button where style
I am creating a web application that will have many users. Each user has
I am creating a web application in ASP.net/VB.NET and I have an issue with
I creating a web application using JSF,Hibernate,Spring. I have added a filter for checking
I'm creating a web application using spring mvc. I have started to incorporate the
I've creating one ASP web application, in that application one form have to update
I am creating a web application and have the following problem. In my application
I'm creating a web application and I have some feature where the user can
I have a web application that is based on the users creating certain divs
We have an ideological problem while creating a Web Application in JSF, EJB and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.