hairi11

Forum Replies Created

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • in reply to: pretty url broken #27582

    hairi11
    Participant

    because I’m using actionListener=”#{bean.save}”.

    of course there is lots of operation in the save method.

    i just put a snipped of code

    in reply to: pretty url broken #27579

    hairi11
    Participant

    Hi.

    Please see code snipped. thx

    <url-mapping parentId="ilibrary" id="publication-edit">
    	<pattern value="/edit/#{pubCategoryCode}/#{publicationId}" />
    	<view-id value="/pages/protected/isralib/publication/edit.xhtml" />
    </url-mapping>
    
    <url-mapping parentId="ilibrary" id="publication-view">
    	<pattern value="/view/#{pubCategoryCode}/#{publicationId}" />
    	<view-id value="/pages/public/isralib/publication/view.xhtml" />
    </url-mapping>
    
    <h:form id="edit" enctype="multipart/form-data">
    	<p:commandButton value="#{msg['global.btn.save']}"
    				 actionListener="#{bean.save}"
    				 ajax="false" styleClass="GreenButton">
    		<f:param name="pubCategoryCode" value="PBB"/>
    	</p:commandButton>
    </h:form>
    
    save() {
    	FacesContext facesContext = FacesContext.getCurrentInstance();
    	ExternalContext externalContext = facesContext.getExternalContext();
    	HttpServletRequest request = (HttpServletRequest) externalContext.getRequest();
    	String url = request.getRequestURL().toString().replace(request.getRequestURI().substring(0), "") + request.getContextPath();
    	String path = "/pages/public/isralib/publication/view.xhtml?publicationId=8123&pubCategoryCode=PBB&faces-redirect=true";
    
    	try {
    	    externalContext.redirect(url + path);
    	} catch (IOException e) {
    	    getLogger().error("Redirect failed", e);
    	}
    
    }
    
    in reply to: hide extra parameter #27574

    hairi11
    Participant

    that why I said unfortunately. I need the extra parameter to send to managedbean but I don’t need it to show in url.

    but I tight with SEO url friendly

    “I’m expecting => /pages/view/1

    actual => /pages/view/1?page=journal”

    the seo url friendly just wanna to see /pages/view/1 without page=journal.

    can we achieve that with prettyfaces?

    thanks

    /Hairi

    in reply to: hide extra parameter #27572

    hairi11
    Participant

    sorry. don’t border about ” “unfortunately I need to send it””.

    actually I send 2 parameters but I want only one of them show in url

    in reply to: hide extra parameter #27570

    hairi11
    Participant

    sorry my bad.

    I’m expecting => /pages/view/1

    actual => /pages/view/1?page=journal

    I’m trying to remove the page=journal but unfortunately I need to send it

    Thanks

    in reply to: navigate to other page with same pattern #27567

    hairi11
    Participant

    thanks for the idea.

    its good if it can detect the url mapping using data to.

    Regards

    in reply to: navigate to other page with same pattern #27565

    hairi11
    Participant

    ignore this post. wrong explanation. please use the latest post

Viewing 7 posts - 1 through 7 (of 7 total)