问题
How I can decode WebSphere Portal url?
For example this url: /wps/portal/!ut/p/c5/dY7LdoIwAAW_hS9ICEnEZSBaKBSKkUfZcAKtKRYMKo-2X197XHtnObO4oAQ3TnJulRxbfZIdKEBJK2wn24ylATUpWUNfhLt9anHTJgg8g1J1ur6VOX_T31wzxRk_4NHZobEvzs5Vu6o3942nbJRTEpNl-UHmoK5JGlfvpOHThtV04ksmNlac5oHuz-HWb4QMcTQHr11SE3xZTUPdz9GvKwkTRfsydMdJHrQTd-vPizIMkP8_p5X7xDy8CiGMUQYhiohIYCos6Ft3Dx-MQRB5uv8Aw1cNj5gZfxocKIs!/dl3/d3/L2dJQSEvUUt3QS9ZQnZ3LzZfNDhRRlZBVUs2UEZMRDBJU1RDTEZIRTEwTDM!/
Is it possible?
回答1:
Try the following:
/wps/poc?uri=state:URL&mode=download
where URL is your original URL for example:
/wps/poc?uri=state:/wps/portal/!ut/p/c5/dY7LdoIwAAW_hS9ICEnEZSBaKBSKkUfZcAKtKRYMKo-2X197XHtnObO4oAQ3TnJulRxbfZIdKEBJK2wn24ylATUpWUNfhLt9anHTJgg8g1J1ur6VOX_T31wzxRk_4NHZobEvzs5Vu6o3942nbJRTEpNl-UHmoK5JGlfvpOHThtV04ksmNlac5oHuz-HWb4QMcTQHr11SE3xZTUPdz9GvKwkTRfsydMdJHrQTd-vPizIMkP8_p5X7xDy8CiGMUQYhiohIYCos6Ft3Dx-MQRB5uv8Aw1cNj5gZfxocKIs!/dl3/d3/L2dJQSEvUUt3QS9ZQnZ3LzZfNDhRRlZBVUs2UEZMRDBJU1RDTEZIRTEwTDM!/&mode=download
I do not have a running portal to check that but according to my notes it should work.
回答2:
Michal's answer is correct, calling the POC servlet that way will decode the state information in the URL and produce an XML representation.
The format of this XML is not published, but is pretty easy to decipher, here's an example of how it can look:
<root session="1977644512">
<state type="navigational">
<portlet id="Z7_C2ORULUV0G8BD0IR4S6TP030G6">
<window-state>minimized</window-state>
</portlet>
<selection selection-node="Z6_C2ORULUV00A520IBF1FAOO10G6">
<mapping src="Z6_C2ORULUV0GP520IBIUSMBS0040" dst="Z6_C2ORULUV00A520IBF1FAOO10G6"/>
<mapping src="Z6_000000000000000000000000A0" dst="Z6_C2ORULUV001S30IR8FCN1Q3001"/>
<mapping src="Z6_C2ORULUV001S30IR8FCN1Q3001" dst="Z6_C2ORULUV0GP520IBIUSMBS0040"/>
</selection>
<expansions>
<node id="Z6_C2ORULUV0GP520IBIUSMBS00O5"/>
<node id="Z6_CGAH47L008LG50IAHUR9Q330A3"/>
<node id="Z6_000000000000000000000000A0"/>
</expansions>
<theme-template>Home</theme-template>
<portlet id="Z7_CGAH47L008LG50IAHUR9Q33803" portlet-type="legacy"/>
</state>
<target portlet-type="legacy" portlet-id="Z7_CGAH47L008LG50IAHUR9Q33803" id="LSzyY48160027">
<target-type>action</target-type>
<action-ref>sa.spf_ActionListener</action-ref>
</target>
</root>
Inspecting the XML allows you to do qualified guesses as to what the different information actually means. The <portlet>
section(s) for example, clearly contains information about the window state and can probably also contain information about portlet mode. The <selection>
section contains the selection path that the user has traveled, and so on.
Since I don't know what you are planning to use the decoded information for, I can't give you any specific guidelines, but consider the XML representation of the state information internal and do not base any application logic on it, since it can change at any point in time.
It can be useful to decode it for troubleshooting though, and to get a general insight in the URL handling of the Portal.
回答3:
This worked for me...http:server:port/context root/contenthandler?uri=state:
来源:https://stackoverflow.com/questions/12848126/websphere-portal-decode-url